summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.c
diff options
context:
space:
mode:
authorKarel Zak2015-03-13 13:35:20 +0100
committerKarel Zak2015-03-13 15:36:39 +0100
commit7ff6948e59172c1942544c9a064708e5666ba20d (patch)
tree7e5955d81b78d7d53a96fed06f0921d1ae13f871 /misc-utils/logger.c
parenttests: fix fdisk/bsd for ppc64le (diff)
downloadkernel-qcow2-util-linux-7ff6948e59172c1942544c9a064708e5666ba20d.tar.gz
kernel-qcow2-util-linux-7ff6948e59172c1942544c9a064708e5666ba20d.tar.xz
kernel-qcow2-util-linux-7ff6948e59172c1942544c9a064708e5666ba20d.zip
logger: use xstrdup()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/logger.c')
-rw-r--r--misc-utils/logger.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 9c6d6a216..ab734ddd6 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -407,7 +407,7 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
} else
err(EXIT_FAILURE, _("localtime() failed"));
} else
- time = strdup(NILVALUE);
+ time = xstrdup(NILVALUE);
char *hostname;
if (ctl->rfc5424_host) {
@@ -418,7 +418,7 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
errx(EXIT_FAILURE, _("hostname '%s' is too long"),
hostname);
} else
- hostname = strdup(NILVALUE);
+ hostname = xstrdup(NILVALUE);
char *const app_name = ctl->tag;
if (48 < strlen(ctl->tag))
@@ -428,9 +428,9 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
if (ctl->pid)
xasprintf(&procid, "%d", ctl->pid);
else
- procid = strdup(NILVALUE);
+ procid = xstrdup(NILVALUE);
- char *const msgid = strdup((ctl->msgid) ? ctl->msgid : NILVALUE);
+ char *const msgid = xstrdup((ctl->msgid) ? ctl->msgid : NILVALUE);
char *structured_data;
if (ctl->rfc5424_tq) {