diff options
-rw-r--r-- | doc/HISTORY | 3 | ||||
-rw-r--r-- | editor/pamscale.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY index aa9ae261..587da0de 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -27,6 +27,9 @@ not yet BJH Release 10.56.00 pnmquant: work with older Perl that doesn't have 3-argument open. Thanks Slaven Rezic <srezic@iconmobile.com>. + pamscale: Issue error message instead of ignoring extraneous + arguments. + libnetpbm, many programs: fix bug in pm_allocarray(): returns NULL when can't get memory. Calling programs thus crash on very large images. Introduced in 10.51. diff --git a/editor/pamscale.c b/editor/pamscale.c index 23fe2707..a113f328 100644 --- a/editor/pamscale.c +++ b/editor/pamscale.c @@ -590,8 +590,15 @@ parseScaleParms(int const argc, else { if (argc-1 < 2) cmdlineP->inputFileName = "-"; - else + else { cmdlineP->inputFileName = argv[2]; + + if (argc-1 > 2) + pm_error("Too many arguments. There are at most two " + "arguments with this set of options: " + "scale factor and input file name. " + "You specified %u", argc-1); + } } } } |