Returning NULL here if malloc(3) fails is silly, at this point in the codepath

we have't malloc(3)'d nearly as much as we probably will, so errx(3) away,
instead of waiting for something to fail yet again later on.
This commit is contained in:
Juli Mallett 2002-06-05 01:36:30 +00:00
parent 86f54b9fb8
commit 05051e2898

View file

@ -125,7 +125,7 @@ fmt_argv(char **argv, char *cmd, size_t maxlen)
}
cp = malloc(len);
if (cp == NULL)
return (NULL);
errx(1, "malloc failed");
if (ap == NULL)
sprintf(cp, " (%.*s)", (int)maxlen, cmd);
else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)