Skip to contentSkip to conversation

master - log: fix message prefix truncation

PATCH Alasdair Kergon 1 participant 1 message Jun 27, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7f1ec681d65001ed3c74a7c7239efa98a8507d88
Commit:        7f1ec681d65001ed3c74a7c7239efa98a8507d88
Parent:        3fe67217d46d2bb496b5c09b0314c7260ed6c24f
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Tue Jun 27 12:41:59 2017 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Tue Jun 27 12:41:59 2017 +0100

log: fix message prefix truncation

Restore the 29-character prefix limit that commit e907535ab977ea29319aeb015cec6c06729f7ce4 ("coverity: use better function") accidentally reduced to 28 characters.

---
 lib/log/log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/log/log.c +1 -1
index 8f52623..8ca60e4 100644
@@ -376,7 +376,7 @@ void fin_syslog(void)
 void init_msg_prefix(const char *prefix)
 {
 	if (prefix)
-		dm_strncpy(_msg_prefix, prefix, sizeof(_msg_prefix) - 1);
+		dm_strncpy(_msg_prefix, prefix, sizeof(_msg_prefix));
 }
 
 void init_indent(int indent)