summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 784357e9370..4143cb6058a 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1741,8 +1741,9 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
ensure_hostname();
state.hs_len = snprintf(state.header_str,
sizeof(state.header_str),
- "%s %s %s[%u]: ",
+ "%s %.*s %s[%u]: ",
tvbuf.buf,
+ (int)(sizeof(state.hostname) - 1),
state.hostname,
state.prog_name,
(unsigned int) getpid());