diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-09-25 17:28:56 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-09-25 17:28:56 +0000 |
commit | e4c244733304769e19525fb05792d4c80e1c909f (patch) | |
tree | 47a93b5ee8040f4aab302cd79870714b2fc1253d | |
parent | 83e0c869dc6b7eced666d4ed0691255498fa9ebc (diff) | |
download | netpbm-mirror-e4c244733304769e19525fb05792d4c80e1c909f.tar.gz netpbm-mirror-e4c244733304769e19525fb05792d4c80e1c909f.tar.xz netpbm-mirror-e4c244733304769e19525fb05792d4c80e1c909f.zip |
Error message instead of ignoring extraneous parameters
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1572 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-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); + } } } } |