summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-13 09:00:11 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-13 09:00:11 +0000
commit7ef19ee4bcb089c4894a864b1348f81a1dd07cd0 (patch)
tree0e8d922e419c2c495225dcf025a6a47a625398cd /source3/printing
parent396311075cc808278e6dd8469e3ac7eb7e7498c7 (diff)
downloadsamba-7ef19ee4bcb089c4894a864b1348f81a1dd07cd0.tar.gz
samba-7ef19ee4bcb089c4894a864b1348f81a1dd07cd0.tar.bz2
samba-7ef19ee4bcb089c4894a864b1348f81a1dd07cd0.zip
don't allow newlines in printer status messages
(This used to be commit d84f5402fded4ffb9c2735fecaa47ec3d2c636c0)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 7ffded8e91..00df859e0a 100644
--- a/source3/printing/printing.c
+++ b/source3/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)
{