X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fscan.c;h=705ff69b6a1d072dc9fbb9250bef3bd806fc5dec;hb=aa2501ef873e96a8500c53b05280dcc0ade952c2;hp=a53a5bad51522dfbf3ea4c35347c59ed5f3efb6c;hpb=945aa62b814966a1266a5524bd089a74e0999cd1;p=mmh diff --git a/uip/scan.c b/uip/scan.c index a53a5ba..705ff69 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -51,7 +52,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; /* * global for sbr/formatsbr.c - yech! @@ -97,8 +97,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))); /* * Parse arguments @@ -178,9 +177,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; }