From: Edward d'Auvergne Date: Thu, 10 Dec 2015 08:13:34 +0000 (+0100) Subject: LaRCsim cleanup of -Wformat-contains-nul compilation warnings. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cf9e3e7bf0a5dacaaa6139c6f74579cac8dc4513;p=flightgear.git LaRCsim cleanup of -Wformat-contains-nul compilation warnings. The sprintf() function automatically adds the terminating null character, so no need to have it in the formatting string. --- diff --git a/src/FDM/LaRCsim/ls_interface.c b/src/FDM/LaRCsim/ls_interface.c index 3ac0cb2a3..c7dd06516 100644 --- a/src/FDM/LaRCsim/ls_interface.c +++ b/src/FDM/LaRCsim/ls_interface.c @@ -295,8 +295,8 @@ void ls_stamp( void ) { date = (nowtime->tm_year % 100)*10000 + (nowtime->tm_mon + 1)*100 + (nowtime->tm_mday); - sprintf(sim_control_.date_string, "%06ld\0", date); - sprintf(sim_control_.time_stamp, "%02d:%02d:%02d\0", + sprintf(sim_control_.date_string, "%06ld", date); + sprintf(sim_control_.time_stamp, "%02d:%02d:%02d", nowtime->tm_hour, nowtime->tm_min, nowtime->tm_sec); #ifdef COMPILE_THIS_CODE_THIS_USELESS_CODE cuserid( sim_control_.userid ); /* set up user id */