-
-/*
- * 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
}
}
- argvarray = (char **) mh_xmalloc((sizeof(char **) * (MAXARGS + 5)));
+ argvarray = (char **)mh_xmalloc(sizeof *argvarray * (MAXARGS + 5));
/*
* The simple case - no spaces or shell metacharacters
{
int i;
- mh_xfree(command);
+ free(command);
if (argvarray != NULL) {
for (i = 0; argvarray[i] != NULL; i++)
*/
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--)