Yet another 1-char-off bug in log_manager
This commit is contained in:
@ -741,13 +741,13 @@ static int logmanager_write_log(
|
||||
timestamp_len = get_timestamp_len();
|
||||
|
||||
/** Find out how much can be safely written with current block size */
|
||||
if (timestamp_len-1+sesid_str_len-1+str_len > lf->lf_buf_size)
|
||||
if (timestamp_len-1+MAX(sesid_str_len-1,0)+str_len > lf->lf_buf_size)
|
||||
{
|
||||
safe_str_len = lf->lf_buf_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_str_len = timestamp_len-1+sesid_str_len-1+str_len;
|
||||
safe_str_len = timestamp_len-1+MAX(sesid_str_len-1,0)+str_len;
|
||||
}
|
||||
/**
|
||||
* Seek write position and register to block buffer.
|
||||
@ -809,10 +809,6 @@ static int logmanager_write_log(
|
||||
sesid_str_len,
|
||||
"[%lu] ",
|
||||
tls_log_info.li_sesid);
|
||||
}
|
||||
|
||||
if (sesid_str_len != 0)
|
||||
{
|
||||
sesid_str_len -= 1; /*< don't calculate terminating char anymore */
|
||||
}
|
||||
/**
|
||||
|
Reference in New Issue
Block a user