From: Andrew Tridgell Date: Tue, 13 Aug 1996 09:00:11 +0000 (+0000) Subject: don't allow newlines in printer status messages X-Git-Tag: samba-1.9.16alpha17~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d84f5402fded4ffb9c2735fecaa47ec3d2c636c0;p=thirdparty%2Fsamba.git don't allow newlines in printer status messages --- diff --git a/source/printing/printing.c b/source/printing/printing.c index 7ffded8e91e..00df859e0ab 100644 --- a/source/printing/printing.c +++ b/source/printing/printing.c @@ -714,7 +714,10 @@ static BOOL parse_lpq_entry(int snum,char *line, #endif /* We don't want the newline in the status message. */ - line[strcspn(line,"\n")] = (char)NULL; + { + char *p = strchr(line,'\n'); + if (p) *p = 0; + } if (status && !ret) {