summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2004-04-29 23:05:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:22 -0500
commit9139b89259afaf3772bbbb92ea925d015d5850ad (patch)
tree4b0e3bc48a2f27e70cbb7b23f6fd1ac8b8a312f9 /source3/lib
parent0922c254c6c8c941ebc7321b1c7114c1a5abd880 (diff)
downloadsamba-9139b89259afaf3772bbbb92ea925d015d5850ad.tar.gz
samba-9139b89259afaf3772bbbb92ea925d015d5850ad.tar.bz2
samba-9139b89259afaf3772bbbb92ea925d015d5850ad.zip
r416: add a newline to the debuglevel message returned string
and have smbcontrol print the PID with it (This used to be commit d3edf71885bfb5d342e62d46542db8ca814f3303)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/debug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 1a926053bb..fe4cd52a8b 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -208,8 +208,8 @@ static char *debug_list_class_names_and_levels(void)
dim += l;
}
- /* create single string list */
- b = buf = malloc(dim);
+ /* create single string list - add space for newline */
+ b = buf = malloc(dim+1);
if (!buf) {
err = True;
goto done;
@@ -219,7 +219,8 @@ static char *debug_list_class_names_and_levels(void)
strncpy(b, list[i], l);
b = b + l;
}
- b[-1] = '\0';
+ b[-1] = '\n'; /* replace last space with newline */
+ b[0] = '\0'; /* null terminate string */
done:
/* free strings list */