]> git.mxchange.org Git - flightgear.git/commitdiff
make sure snprintf() buffer is terminated
authormfranz <mfranz>
Sat, 27 Oct 2007 17:16:00 +0000 (17:16 +0000)
committermfranz <mfranz>
Sat, 27 Oct 2007 17:16:00 +0000 (17:16 +0000)
src/Main/fg_props.cxx

index a56cfc59cd17c6a03eb1e667cbc1c82afa9474e7..ffcf8dedf41ba74590ca619eae8fdbb6bcc180f2 100644 (file)
@@ -463,6 +463,7 @@ getLongitudeString ()
     snprintf(buf, 32, "%d*%02d %04.1f%c", int(d < 0.0 ? -deg : deg),
         int(min), fabs(sec), c);
   }
+  buf[31] = '\0';
   return buf;
 }
 
@@ -491,6 +492,7 @@ getLatitudeString ()
     snprintf(buf, 32, "%d*%02d %04.1f%c", int(d < 0.0 ? -deg : deg),
         int(min), fabs(sec), c);
   }
+  buf[31] = '\0';
   return buf;
 }