don't allow newlines in printer status messages
authorAndrew Tridgell <tridge@samba.org>
Tue, 13 Aug 1996 09:00:11 +0000 (09:00 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 13 Aug 1996 09:00:11 +0000 (09:00 +0000)
(This used to be commit d84f5402fded4ffb9c2735fecaa47ec3d2c636c0)

source3/printing/printing.c

index 7ffded8e91e0dfbc86f24a8c625c465619572ecf..00df859e0ab752dff144cdff67e04facd525d170 100644 (file)
@@ -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)
     {