Fixed snprint_timestamp function which left one byte garbage to log file.

This commit is contained in:
vraatikka 2013-11-12 17:49:28 +02:00
parent 836c7ad76d
commit 1a3fa578da
2 changed files with 5 additions and 5 deletions

View File

@ -123,8 +123,8 @@ GWPROTOCOL *funcs;
port->listener = NULL;
skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Unable to load protocol module %s. Listener for "
"service %s not started.",
"Error : Unable to load protocol module %s. Listener "
"for service %s not started.",
port->protocol,
service->name);
return 0;

View File

@ -678,7 +678,7 @@ int snprint_timestamp(
tm.tm_sec);
return_p_ts:
return (MIN(tslen,timestamp_len));
return (strlen(p_ts));
}
@ -1664,13 +1664,13 @@ static bool file_write_footer(
const char* header_buf4;
CHK_FILE(file);
header_buf1 = "MaxScale is shut down\t";
header_buf1 = "MaxScale is shut down.\t";
tslen = get_timestamp_len();
header_buf3 = (char *)malloc(tslen);
if (header_buf3 == NULL) {
goto return_succp;
}
tslen = snprint_timestamp(header_buf3, tslen);
tslen = snprint_timestamp(header_buf3, tslen-1);
header_buf4 = "\n--------------------------------------------"
"---------------------------\n";