about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-11-15 03:15:08 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-11-15 03:15:08 +0000
commit21a6169786e8c2c61b28f14cda14cc2f23621ccc (patch)
treeec5ff34c08b5c58818965773898f62584a1059be /generator
parentf34ee94b822b1238ce874ee314b032f64e12f4a3 (diff)
downloadnetpbm-mirror-21a6169786e8c2c61b28f14cda14cc2f23621ccc.tar.gz
netpbm-mirror-21a6169786e8c2c61b28f14cda14cc2f23621ccc.tar.xz
netpbm-mirror-21a6169786e8c2c61b28f14cda14cc2f23621ccc.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2311 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/ppmrough.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generator/ppmrough.c b/generator/ppmrough.c
index 5d5bdeda..e749c9c2 100644
--- a/generator/ppmrough.c
+++ b/generator/ppmrough.c
@@ -15,6 +15,7 @@
 #include <sys/time.h>
 
 #include "pm_c_util.h"
+#include "mallocvar.h"
 #include "shhopt.h"
 #include "ppm.h"
 
@@ -38,14 +39,16 @@ struct CmdlineInfo {
 
 static void
 parseCommandLine(int argc, const char ** argv,
-                 struct CmdlineInfo * const cmdlineP)
-{
-    optEntry *option_def = malloc(100*sizeof(optEntry));
-    /* Instructions to OptParseOptions2 on how to parse our options.    */
+                 struct CmdlineInfo * const cmdlineP) {
+
+    optEntry * option_def;
+        /* Instructions to OptParseOptions2 on how to parse our options.    */
     optStruct3 opt;
 
     unsigned int option_def_index;
 
+    MALLOCARRAY(option_def, 100);
+
     option_def_index = 0;   /* incremented by OPTENTRY */
     OPTENT3(0, "width",       OPT_UINT,   &cmdlineP->width,   NULL, 0);
     OPTENT3(0, "height",      OPT_UINT,   &cmdlineP->height,  NULL, 0);