diff options
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r-- | lib/util/debug.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 5d202ef8be..0e8c1d3904 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -1009,13 +1009,14 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) verbose = true; } - if (verbose || state.settings.debug_pid) - slprintf(header_str,sizeof(header_str)-1,", pid=%u",(unsigned int)getpid()); + if (verbose || state.settings.debug_pid) { + snprintf(header_str, sizeof(header_str), ", pid=%u", + (unsigned int)getpid()); + } if (verbose || state.settings.debug_uid) { size_t hs_len = strlen(header_str); - slprintf(header_str + hs_len, - sizeof(header_str) - 1 - hs_len, + snprintf(header_str + hs_len, sizeof(header_str) - hs_len, ", effective(%u, %u), real(%u, %u)", (unsigned int)geteuid(), (unsigned int)getegid(), (unsigned int)getuid(), (unsigned int)getgid()); @@ -1024,8 +1025,8 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) if ((verbose || state.settings.debug_class) && (cls != DBGC_ALL)) { size_t hs_len = strlen(header_str); - slprintf(header_str + hs_len, - sizeof(header_str) -1 - hs_len, + snprintf(header_str + hs_len, + sizeof(header_str) - hs_len, ", class=%s", classname_table[cls]); } |