Permalink
Browse files

fix \n logging

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information...
1 parent da01557 commit 4bc371fd9d1930920f8b5cd5e14583007d2644cf @fabbione committed Jan 28, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 libknet/logging.c
View
5 libknet/logging.c
@@ -127,9 +127,12 @@ void log_msg(knet_handle_t knet_h, uint8_t subsystem, uint8_t msglevel,
return;
va_start(ap, fmt);
- vsnprintf(msg.msg, sizeof(msg.msg) - 1, fmt, ap);
+ vsnprintf(msg.msg, sizeof(msg.msg) - 2, fmt, ap);
va_end(ap);
+ len = strlen(msg.msg);
+ msg.msg[len+1] = '\n';
+
if (!err)
pthread_rwlock_unlock(&knet_h->list_rwlock);

0 comments on commit 4bc371f

Please sign in to comment.