about summary refs log tree commit diff
path: root/converter/pbm/pbmtoescp2.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-16 18:44:30 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-16 18:44:30 +0000
commitf6d7d2d75fc8913228646fef19204a46941623e4 (patch)
treea3d60bef2f71e5c0ecd5c1a424ec429effe171c1 /converter/pbm/pbmtoescp2.c
parent044bced7bc3d18d57665aa963799a35a31db588b (diff)
downloadnetpbm-mirror-f6d7d2d75fc8913228646fef19204a46941623e4.tar.gz
netpbm-mirror-f6d7d2d75fc8913228646fef19204a46941623e4.tar.xz
netpbm-mirror-f6d7d2d75fc8913228646fef19204a46941623e4.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4883 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm/pbmtoescp2.c')
-rw-r--r--converter/pbm/pbmtoescp2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/converter/pbm/pbmtoescp2.c b/converter/pbm/pbmtoescp2.c
index 54a77e44..d4d98388 100644
--- a/converter/pbm/pbmtoescp2.c
+++ b/converter/pbm/pbmtoescp2.c
@@ -49,12 +49,15 @@ parseCommandLine(int argc, const char ** argv,
                  struct CmdlineInfo *cmdlineP) {
 
     optStruct3 opt;
-    unsigned int option_def_index = 0;
-    optEntry * option_def = malloc(100*sizeof(optEntry));
+    unsigned int option_def_index;
+    optEntry * option_def;
 
     unsigned int compressSpec, resolutionSpec, stripeHeightSpec,
                  rawSpec, formfeedSpec;
 
+    MALLOCARRAY(option_def, 100);
+
+    option_def_index = 0;
     opt.opt_table = option_def;
     opt.short_allowed = FALSE;
     opt.allowNegNum = FALSE;
@@ -69,7 +72,7 @@ parseCommandLine(int argc, const char ** argv,
     OPTENT3(0, "formfeed",     OPT_FLAG,    NULL,
             &formfeedSpec,    0);
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
 
     if (argc-1 > 1)
         pm_error("Too many arguments: %d.  "