From eabc1fce74d67e6e7c765c12e5d86bb31bfd6838 Mon Sep 17 00:00:00 2001 From: Joe Da Silva Date: Sun, 5 Jul 2026 20:56:15 -0700 Subject: [PATCH] Limit parameter -n[1-999] since range allows only @PJL SET COPIES=[1-999] Applied to all drivers for consistency even if some are not implemented. --- foo2ddst.c | 5 ++++- foo2hbpl2.c | 5 ++++- foo2hiperc.c | 5 ++++- foo2hp.c | 5 ++++- foo2lava.c | 5 ++++- foo2oak.c | 5 ++++- foo2qpdl.c | 5 ++++- foo2slx.c | 5 ++++- foo2xqx.c | 5 ++++- foo2zjs.c | 5 ++++- 10 files changed, 40 insertions(+), 10 deletions(-) diff --git a/foo2ddst.c b/foo2ddst.c index c8bfd07..5501796 100644 --- a/foo2ddst.c +++ b/foo2ddst.c @@ -1439,7 +1439,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2hbpl2.c b/foo2hbpl2.c index 4da685b..65d8802 100644 --- a/foo2hbpl2.c +++ b/foo2hbpl2.c @@ -1521,7 +1521,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2hiperc.c b/foo2hiperc.c index bb220ea..f1fdee5 100644 --- a/foo2hiperc.c +++ b/foo2hiperc.c @@ -1595,7 +1595,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2hp.c b/foo2hp.c index 0f73451..d17c8c5 100644 --- a/foo2hp.c +++ b/foo2hp.c @@ -1708,7 +1708,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2lava.c b/foo2lava.c index 7caa7ad..8115203 100644 --- a/foo2lava.c +++ b/foo2lava.c @@ -1559,7 +1559,10 @@ main(int argc, char *argv[]) else MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': if (strstr(optarg,"in") || strstr(optarg, "mm")) PaperStr = optarg; else diff --git a/foo2oak.c b/foo2oak.c index 65acdfc..646d012 100644 --- a/foo2oak.c +++ b/foo2oak.c @@ -1921,7 +1921,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2qpdl.c b/foo2qpdl.c index 40d2093..2fd135b 100644 --- a/foo2qpdl.c +++ b/foo2qpdl.c @@ -1735,7 +1735,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2slx.c b/foo2slx.c index 7e2ffdd..75048ac 100644 --- a/foo2slx.c +++ b/foo2slx.c @@ -1434,7 +1434,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2xqx.c b/foo2xqx.c index 10b9d60..f31529b 100644 --- a/foo2xqx.c +++ b/foo2xqx.c @@ -1381,7 +1381,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg); diff --git a/foo2zjs.c b/foo2zjs.c index 98a2c8e..5bc87c3 100644 --- a/foo2zjs.c +++ b/foo2zjs.c @@ -1801,7 +1801,10 @@ main(int argc, char *argv[]) error(1, "Illegal Y value '%s' for -g\n", optarg); break; case 'm': MediaCode = atoi(optarg); break; - case 'n': Copies = atoi(optarg); break; + case 'n': Copies = atoi(optarg); + if (Copies < 1 || Copies > 999) + error(1, "Illegal value '%s' for Copies -n\n", optarg); + break; case 'p': PaperCode = atoi(optarg); break; case 'r': if (parse_xy(optarg, &ResX, &ResY)) error(1, "Illegal format '%s' for -r\n", optarg);