]> git.mxchange.org Git - flightgear.git/commitdiff
Dave LUFF: Fix buffer overrun with longer runways
authormfranz <mfranz>
Mon, 1 Jun 2009 10:32:44 +0000 (10:32 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 2 Jun 2009 22:18:56 +0000 (00:18 +0200)
src/Instrumentation/dclgps.cxx

index 3156c55ac531f6cfd58e40898dd2d80a33963aee..9d6ccc67575c00232718435535497ecb28e7383a 100644 (file)
@@ -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);
 }