about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-12-29 19:10:39 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-12-29 19:10:39 +0000
commitbe7356da944e6ed13af2947751b238a9efe02b53 (patch)
tree7bb388bf42b70b915adf05c61f48185fa025ab66 /generator
parentf2a10c7336414de4f19b3c8e6095904211a9147f (diff)
downloadnetpbm-mirror-be7356da944e6ed13af2947751b238a9efe02b53.tar.gz
netpbm-mirror-be7356da944e6ed13af2947751b238a9efe02b53.tar.xz
netpbm-mirror-be7356da944e6ed13af2947751b238a9efe02b53.zip
validate dimension inputs
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@510 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/ppmmake.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/generator/ppmmake.c b/generator/ppmmake.c
index eee32485..e59b47d5 100644
--- a/generator/ppmmake.c
+++ b/generator/ppmmake.c
@@ -76,14 +76,8 @@ parseCommandLine(int argc, char ** argv,
                  "You specified %d", argc-1);
     else {
         cmdlineP->color = ppm_parsecolor(argv[1], cmdlineP->maxval);
-        cmdlineP->cols = atoi(argv[2]);
-        cmdlineP->rows = atoi(argv[3]);
-        if (cmdlineP->cols <= 0)
-            pm_error("width argument must be a positive number.  You "
-                     "specified '%s'", argv[2]);
-        if (cmdlineP->rows <= 0)
-            pm_error("height argument must be a positive number.  You "
-                     "specified '%s'", argv[3]);
+        cmdlineP->cols = pm_parse_width(argv[2]);
+        cmdlineP->rows = pm_parse_height(argv[3]);
     }
 }