summaryrefslogtreecommitdiff
path: root/source/printing/printing.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/printing/printing.c')
-rw-r--r--source/printing/printing.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c
index 2eef0d303bc..7ffded8e91e 100644
--- a/source/printing/printing.c
+++ b/source/printing/printing.c
@@ -73,7 +73,7 @@ static char *build_print_command(int cnum, char *command, char *syscmd, char *fi
}
if (strstr(syscmd,"%s")) {
- int iOffset = strstr(syscmd, "%s") - syscmd;
+ int iOffset = PTR_DIFF(strstr(syscmd, "%s"),syscmd);
/* construct the full path for the filename, shouldn't be necessary unless
the subshell causes a "cd" to be executed.
@@ -713,6 +713,9 @@ 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;
+
if (status && !ret)
{
/* a few simple checks to see if the line might be a