Corrected a typo in line feed handling.

This commit is contained in:
vraatikka 2013-07-27 12:23:47 +03:00
parent 7a6129861e
commit 25d26eb3b8

View File

@ -570,9 +570,11 @@ static int logmanager_write_log(
} else {
snprintf(wp+timestamp_len-1, str_len, str);
}
if (wp[timestamp_len-1+str_len-2] != '\n') {
wp[timestamp_len-1+str_len-1]='\n';
/** remove double line feed */
if (wp[timestamp_len-1+str_len-2] == '\n') {
wp[timestamp_len-1+str_len-2]=' ';
}
wp[timestamp_len-1+str_len-1]='\n';
/** lock-free unregistration, includes flush if bb_isfull */
blockbuf_unregister(bb);