From: mfranz Date: Sat, 27 Oct 2007 17:16:00 +0000 (+0000) Subject: make sure snprintf() buffer is terminated X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1c1559f36c9466204c888cf85002c2468aafe941;p=flightgear.git make sure snprintf() buffer is terminated --- diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index a56cfc59c..ffcf8dedf 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -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; }