Add a newline to the syslog message, if it was missing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25556 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-18 23:06:30 +00:00
parent 519fbf77d3
commit 1fab7b919f

View File

@ -145,6 +145,11 @@ send_syslog_message(syslog_context *context, int priority, const char *text,
int length = vsnprintf(message.message, sizeof(buffer)
- sizeof(syslog_message), text, args);
if (message.message + length - buffer < (int32)sizeof(buffer)) {
if (length == 0 || message.message[length - 1] != '\n')
message.message[length++] = '\n';
} else
buffer[length - 1] = '\n';
status_t status;
do {