summaryrefslogtreecommitdiffstats
path: root/source/lib/debug.c
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2004-04-29 23:05:58 +0000
committerHerb Lewis <herb@samba.org>2004-04-29 23:05:58 +0000
commitdce54a330156e6fa63f9c36d0fad1983e8cc735d (patch)
tree424ec011a76e3dc82737f488eeaad14685739c02 /source/lib/debug.c
parentf1040f57692c3f182ee3abc970dce7f2443e7265 (diff)
downloadsamba-dce54a330156e6fa63f9c36d0fad1983e8cc735d.tar.gz
samba-dce54a330156e6fa63f9c36d0fad1983e8cc735d.tar.xz
samba-dce54a330156e6fa63f9c36d0fad1983e8cc735d.zip
r416: add a newline to the debuglevel message returned string
and have smbcontrol print the PID with it
Diffstat (limited to 'source/lib/debug.c')
-rw-r--r--source/lib/debug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/lib/debug.c b/source/lib/debug.c
index 1a926053bb0..fe4cd52a8b1 100644
--- a/source/lib/debug.c
+++ b/source/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 */