about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-25 21:45:17 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-04-25 21:45:17 +0000
commitcc2c56c7dd0d2855e19fb9692e3d3c6c6b072c67 (patch)
treefdb62074c4bae0b0e57f3202c4d96cf6049147f9
parent46db732a13a90790b158da2a360b92bdcb894440 (diff)
downloadnetpbm-mirror-cc2c56c7dd0d2855e19fb9692e3d3c6c6b072c67.tar.gz
netpbm-mirror-cc2c56c7dd0d2855e19fb9692e3d3c6c6b072c67.tar.xz
netpbm-mirror-cc2c56c7dd0d2855e19fb9692e3d3c6c6b072c67.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@885 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--generator/pbmtext.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generator/pbmtext.c b/generator/pbmtext.c
index ed7f3542..693c3f59 100644
--- a/generator/pbmtext.c
+++ b/generator/pbmtext.c
@@ -43,19 +43,21 @@ struct cmdlineInfo {
 
 
 static void
-parseCommandLine(int argc, char ** argv,
+parseCommandLine(int argc, const char ** argv,
                  struct cmdlineInfo * const cmdlineP) {
 /*----------------------------------------------------------------------------
    Note that the file spec array we return is stored in the storage that
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def = malloc(100*sizeof(optEntry));
+    optEntry * option_def;
         /* Instructions to OptParseOptions3 on how to parse our options.
          */
     optStruct3 opt;
 
     unsigned int option_def_index;
 
+    MALLOCARRAY_NOFAIL(option_def, 100);
+
     option_def_index = 0;   /* incremented by OPTENTRY */
     OPTENT3(0, "font",      OPT_STRING, &cmdlineP->font, NULL,        0);
     OPTENT3(0, "builtin",   OPT_STRING, &cmdlineP->builtin, NULL,     0);
@@ -77,7 +79,7 @@ parseCommandLine(int argc, char ** argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We have no parms that are negative numbers */
 
-    optParseOptions3(&argc, argv, opt, sizeof(opt), 0);
+    optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
     if (argc-1 == 0)
@@ -801,7 +803,7 @@ computeImageWidth(struct text         const formattedText,
 
 
 int
-main(int argc, char *argv[]) {
+main(int argc, const char *argv[]) {
 
     struct cmdlineInfo cmdline;
     bit ** bits;
@@ -812,7 +814,7 @@ main(int argc, char *argv[]) {
     struct text formattedText;
     int maxleftb;
 
-    pbm_init(&argc, argv);
+    pm_proginit(&argc, argv);
 
     parseCommandLine(argc, argv, &cmdline);