From: David Levine Date: Sun, 21 Apr 2013 14:49:48 +0000 (-0500) Subject: Replaced calls to static getcpy() in mf.c with calls to strdup() X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/62ab3819f29a419801665c74944d973101c9c466?hp=9748d5591651713f88af307f5bfbf7c0cbd50db1 Replaced calls to static getcpy() in mf.c with calls to strdup() --- diff --git a/sbr/mf.c b/sbr/mf.c index f993c235..84f1afa9 100644 --- a/sbr/mf.c +++ b/sbr/mf.c @@ -15,7 +15,6 @@ /* * static prototypes */ -static char *getcpy (const char *); static int isat (const char *); static int parse_address (void); static int phrase (char *); @@ -26,25 +25,6 @@ static int route (char *); static int my_lex (char *); -static char * -getcpy (const char *s) -{ - register char *p; - - if (!s) { -/* causes compiles to blow up because the symbol _cleanup is undefined - where did this ever come from? */ - /* _cleanup(); */ - abort(); - for(;;) - pause(); - } - p = mh_xmalloc ((size_t) (strlen (s) + 2)); - strcpy (p, s); - return p; -} - - int isfrom(const char *string) { @@ -218,7 +198,7 @@ getadrx (const char *addrs) err[0] = 0; if (dp == NULL) { - dp = cp = getcpy (addrs ? addrs : ""); + dp = cp = strdup (addrs ? addrs : ""); glevel = 0; } else @@ -299,7 +279,7 @@ again: ; switch (my_lex (buffer)) { case LX_ATOM: case LX_QSTR: - pers = getcpy (buffer); + pers = strdup (buffer); break; case LX_SEMI: @@ -553,7 +533,7 @@ domain (char *buffer) static int route (char *buffer) { - path = getcpy ("@"); + path = strdup ("@"); for (;;) { switch (my_lex (buffer)) { @@ -652,7 +632,7 @@ my_lex (char *buffer) if (--i < 0) { *bp = 0; note = note ? add (buffer, add (" ", note)) - : getcpy (buffer); + : strdup (buffer); return my_lex (buffer); } }