about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-04-15 18:54:17 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-04-15 18:54:17 +0000
commit3432de82ed8357a1e653919c74f1293dfb6c8e07 (patch)
tree0a21b1b3570341c60c470281296f446c37e21c79 /converter
parent82e30079f96ae1c131c5142b699dc3a2f9432fee (diff)
downloadnetpbm-mirror-3432de82ed8357a1e653919c74f1293dfb6c8e07.tar.gz
netpbm-mirror-3432de82ed8357a1e653919c74f1293dfb6c8e07.tar.xz
netpbm-mirror-3432de82ed8357a1e653919c74f1293dfb6c8e07.zip
Release 10.73.09
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2949 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/other/pnmtojpeg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/converter/other/pnmtojpeg.c b/converter/other/pnmtojpeg.c
index ce231c94..7e7272a0 100644
--- a/converter/other/pnmtojpeg.c
+++ b/converter/other/pnmtojpeg.c
@@ -230,7 +230,7 @@ parseCommandLine(const int argc, char ** argv,
     char ** argv_parse;
         /* argv, except we modify it as we parse */
 
-    MALLOCARRAY(argv_parse, argc);
+    MALLOCARRAY(argv_parse, argc + 1);  /* +1 for the terminating null ptr */
 
     option_def_index = 0;   /* incremented by OPTENTRY */
     OPTENT3(0, "verbose",     OPT_FLAG,   NULL, &cmdlineP->verbose,        0);
@@ -273,7 +273,7 @@ parseCommandLine(const int argc, char ** argv,
 
     /* Make private copy of arguments for pm_optParseOptions to corrupt */
     argc_parse = argc;
-    for (i=0; i < argc; i++) argv_parse[i] = argv[i];
+    for (i=0; i < argc+1; i++) argv_parse[i] = argv[i];
 
     opt.opt_table = option_def;
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */