summaryrefslogtreecommitdiffstats
path: root/lib/util/debug.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-29 15:09:00 +0000
committerMichael Adam <obnox@samba.org>2014-07-31 18:49:47 +0200
commitcff585b6e2dff316c9478d470e11aa69faf0f4d5 (patch)
tree3101390c688ddd8cf96f5e3ebc1f05dce3f027eb /lib/util/debug.c
parent601b2b04530445344255992ebf6fb08a5ccf6eaa (diff)
downloadsamba-cff585b6e2dff316c9478d470e11aa69faf0f4d5.tar.gz
samba-cff585b6e2dff316c9478d470e11aa69faf0f4d5.tar.xz
samba-cff585b6e2dff316c9478d470e11aa69faf0f4d5.zip
debug: slprintf->snprintf
snprintf does not need the -1 in sizeof(buf)-1 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r--lib/util/debug.c13
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]);
}