summaryrefslogtreecommitdiffstats
path: root/lib/util/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r--lib/util/debug.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index f94f44310f..9fdad54edb 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1036,14 +1036,17 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
classname_table[cls]);
}
- /* Print it all out at once to prevent split syslog output. */
- if( state.settings.debug_prefix_timestamp ) {
- (void)Debug1("%s] ", header_str);
- } else {
- (void)Debug1("%s] %s(%s)\n",
- header_str, location, func );
+ strlcat(header_str, "] ", sizeof(header_str));
+
+ if (!state.settings.debug_prefix_timestamp) {
+ size_t hs_len = strlen(header_str);
+ snprintf(header_str + hs_len,
+ sizeof(header_str) - hs_len,
+ "%s(%s)\n", location, func);
}
+ (void)Debug1("%s", header_str);
+
errno = old_errno;
return( true );
}