From: mfranz Date: Sat, 17 Jun 2006 18:25:12 +0000 (+0000) Subject: getGMTstring: remove leading space, cleanup X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2360487b198a9cabc91918e6a48020acdbefc1f4;p=flightgear.git getGMTstring: remove leading space, cleanup --- diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index dbe4e537d..aed7cbf0f 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -316,11 +316,10 @@ setDateString (const char * date_string) static const char * getGMTString () { - static char buf[16]; // FIXME + static char buf[16]; struct tm *t = globals->get_time_params()->getGmt(); - sprintf(buf, " %.2d:%.2d:%.2d", - t->tm_hour, t->tm_min, t->tm_sec); - // cout << t << " " << buf << endl; + snprintf(buf, 16, "%.2d:%.2d:%.2d", + t->tm_hour, t->tm_min, t->tm_sec); return buf; }