From 5a200cb5f4539d5af8202281083c50d1a0fd31b5 Mon Sep 17 00:00:00 2001 From: mfranz Date: Mon, 1 Jun 2009 10:32:44 +0000 Subject: [PATCH] Dave LUFF: Fix buffer overrun with longer runways --- src/Instrumentation/dclgps.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Instrumentation/dclgps.cxx b/src/Instrumentation/dclgps.cxx index 3156c55ac..9d6ccc675 100644 --- a/src/Instrumentation/dclgps.cxx +++ b/src/Instrumentation/dclgps.cxx @@ -257,9 +257,8 @@ void GPSPage::OBSPressed() {} void GPSPage::MsgPressed() {} string GPSPage::GPSitoa(int n) { - char buf[4]; - // TODO - sanity check n! - sprintf(buf, "%i", n); + char buf[6]; + snprintf(buf, 6, "%i", n); string s = buf; return(s); }