From dce54a330156e6fa63f9c36d0fad1983e8cc735d 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 --- source/lib/debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/lib/debug.c') 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 */ -- cgit