Skip to content

Commit

Permalink
libflux/flog: use %.*s not %*s to print unterm strings
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Jun 13, 2016
1 parent e15452f commit 4170d08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/libflux/flog.c
Expand Up @@ -258,11 +258,11 @@ void flux_log_fprint (const char *buf, int len, void *arg)

if (f) {
if (stdlog_decode (buf, len, &hdr, NULL, NULL, &msg, &msglen) < 0)
fprintf (f, "%*s\n", len, buf);
fprintf (f, "%.*s\n", len, buf);
else {
nodeid = strtoul (hdr.hostname, NULL, 10);
severity = STDLOG_SEVERITY (hdr.pri);
fprintf (f, "%s %s.%s[%" PRIu32 "]: %*s\n",
fprintf (f, "%s %s.%s[%" PRIu32 "]: %.*s\n",
hdr.timestamp,
hdr.appname,
stdlog_severity_to_string (severity),
Expand Down

0 comments on commit 4170d08

Please sign in to comment.