X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fpick.c;h=8cdfa58070d18555c02c6059a3ac12fc5a9df482;hp=9f4bf0f5746dfa502936bf5700bbe98df5f2dd3c;hb=d2da15ecabb03fb2de72863abdf5f21e52fdf329;hpb=6d51f44e7d886a9d8b6243f414603dc3e1fdd837 diff --git a/uip/pick.c b/uip/pick.c index 9f4bf0f..8cdfa58 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -12,6 +12,7 @@ #include #include #include +#include /* * We allocate space for messages (msgs array) @@ -103,8 +104,7 @@ main (int argc, char **argv) */ nummsgs = 0; maxmsgs = MAXMSGS; - if (!(msgs = (char **) malloc ((size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to allocate storage"); + msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs))); while ((cp = *argp++)) { if (*cp == '-') { @@ -199,9 +199,8 @@ main (int argc, char **argv) */ if (nummsgs >= maxmsgs) { maxmsgs += MAXMSGS; - if (!(msgs = (char **) realloc (msgs, - (size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to reallocate msgs storage"); + msgs = (char **) mh_xrealloc (msgs, + (size_t) (maxmsgs * sizeof(*msgs))); } msgs[nummsgs++] = cp; }