]> diplodocus.org Git - nmh/blobdiff - sbr/arglist.c
Rewrite norm_charmap(), moving code into data.
[nmh] / sbr / arglist.c
index 68a26a203133cbb9644e9bd37f7e4edd12e107a7..cd88b86b54d64cc5e383320d1226c6b845b757c5 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * arglist.c -- Routines for handling argument lists for execvp() and friends
+/* arglist.c -- Routines for handling argument lists for execvp() and friends
  *
  * This code is Copyright (c) 2013, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -133,8 +131,7 @@ arglist_free(char *command, char **argvarray)
 {
     int i;
 
-    if (command != NULL)
-       free(command);
+    mh_xfree(command);
 
     if (argvarray != NULL) {
        for (i = 0; argvarray[i] != NULL; i++)
@@ -202,8 +199,8 @@ argsplit_insert(struct msgs_array *msgs, char *command, char **program)
      */
 
     if (msgs->size + argp >= msgs->max) {
-       msgs->max += MAXMSGS > argp ? MAXMSGS : argp;
-       msgs->msgs = mh_xrealloc(msgs->msgs, msgs->max * sizeof(*msgs->msgs));
+        msgs->max += max(MAXMSGS, argp);
+        msgs->msgs = mh_xrealloc(msgs->msgs, msgs->max * sizeof(*msgs->msgs));
     }
 
     for (i = msgs->size - 1; i >= 0; i--)