All of lore.kernel.org
 help / color / mirror / Atom feed
* master - coverity: use better function
@ 2017-06-27 10:20 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2017-06-27 10:20 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e907535ab977ea29319aeb015cec6c06729f7ce4
Commit:        e907535ab977ea29319aeb015cec6c06729f7ce4
Parent:        e9c60f874ef02c8c5539310223e61e73a8103681
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Jun 27 10:17:33 2017 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Jun 27 12:15:42 2017 +0200

coverity: use better function

---
 lib/log/log.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/log/log.c b/lib/log/log.c
index f9d5649..8f52623 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -375,8 +375,8 @@ void fin_syslog(void)
 
 void init_msg_prefix(const char *prefix)
 {
-	strncpy(_msg_prefix, prefix, sizeof(_msg_prefix) - 1);
-	_msg_prefix[sizeof(_msg_prefix) - 1] = '\0';
+	if (prefix)
+		dm_strncpy(_msg_prefix, prefix, sizeof(_msg_prefix) - 1);
 }
 
 void init_indent(int indent)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-27 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 10:20 master - coverity: use better function Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.