Description: fix compilation with GCC 8 The following fragment of code: . char current_date[50]; { char buf[50]; strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", lt); snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds))); } . leads to the following error when compiled with format string fortification flags (default on Debian): . server/log.c: In function 'get_current_date': server/log.c:64:54: error: '%03d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 49 [-Werror=format-truncation=] snprintf(current_date, sizeof(current_date), "%s.%03d", buf, (int)(1000 * (time-seconds))); ^~~~ . the reason is that in the 'snprintf' call, the %s item is of maximum length of 50, which leads to insufficient room for the %03d item. The 'buf' string doesn't need the room for 50 characters, so decreasing that to 25 seems like a good fix. --- a/server/log.c +++ b/server/log.c @@ -56,7 +56,7 @@ char current_date[50]; char* get_current_date(void) { struct tm * lt; - char buf[50]; + char buf[25]; double time = get_current_time_exact(); time_t seconds = (time_t)time; lt = localtime(&seconds);