From 9139b89259afaf3772bbbb92ea925d015d5850ad Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Thu, 29 Apr 2004 23:05:58 +0000 Subject: r416: add a newline to the debuglevel message returned string and have smbcontrol print the PID with it (This used to be commit d3edf71885bfb5d342e62d46542db8ca814f3303) --- source3/lib/debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/lib/debug.c') 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 */ -- cgit