]> diplodocus.org Git - nmh/blobdiff - sbr/arglist.c
new.c: Order two return statements to match comment.
[nmh] / sbr / arglist.c
index 328d9e9c8f30dfa4cedb05d1d5d65082ca60d039..59d311b210d1b1a8ade66885bfccb2554fb26ffe 100644 (file)
@@ -50,7 +50,7 @@ argsplit(char *command, char **file, int *argp)
        }
     }
 
-    argvarray = (char **) mh_xmalloc((sizeof(char **) * (MAXARGS + 5)));
+    argvarray = (char **)mh_xmalloc(sizeof *argvarray * (MAXARGS + 5));
 
     /*
      * The simple case - no spaces or shell metacharacters
@@ -131,7 +131,7 @@ arglist_free(char *command, char **argvarray)
 {
     int i;
 
-    mh_xfree(command);
+    free(command);
 
     if (argvarray != NULL) {
        for (i = 0; argvarray[i] != NULL; i++)
@@ -199,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--)