about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-09-25 17:28:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2011-09-25 17:28:56 +0000
commite4c244733304769e19525fb05792d4c80e1c909f (patch)
tree47a93b5ee8040f4aab302cd79870714b2fc1253d
parent83e0c869dc6b7eced666d4ed0691255498fa9ebc (diff)
downloadnetpbm-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/HISTORY3
-rw-r--r--editor/pamscale.c9
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);
+            }
         }
     }
 }