From: Ralph Corderoy Date: Sun, 16 Oct 2016 23:32:46 +0000 (+0100) Subject: Delete client_getcpy(); don't know why it exists. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/ab27ece6d6d921bc826ddab57cba370fba7ea89c?ds=inline;hp=3bd5ce286fa6983f3f3f9fda4ff7f2f96c2a22a2 Delete client_getcpy(); don't know why it exists. Replace with calls to getcpy() or mh_xstrdup(). --- diff --git a/sbr/client.c b/sbr/client.c index 7417ed54..6695e084 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -25,7 +25,6 @@ static char **client_brkstring (char *, char *, char *); static int client_brkany (char, char *); static char **client_copyip (char **, char **, int); -static char *client_getcpy (char *); static void client_freelist(char **); @@ -38,15 +37,15 @@ client (char *args, char *service, char *response, int len_response, int debug) ap = arguments; if (args != NULL && *args != 0) { - ap = client_copyip (client_brkstring (client_getcpy (args), " ", "\n"), + ap = client_copyip (client_brkstring (getcpy(args), " ", "\n"), ap, MAXARGS); } else { if (servers != NULL && *servers != 0) - ap = client_copyip (client_brkstring (client_getcpy (servers), " ", "\n"), + ap = client_copyip (client_brkstring (getcpy(servers), " ", "\n"), ap, MAXARGS); } if (ap == arguments) { - *ap++ = client_getcpy ("localhost"); + *ap++ = mh_xstrdup("localhost"); *ap = NULL; } @@ -190,17 +189,3 @@ client_copyip (char **p, char **q, int len_q) return q; } - - -static char * -client_getcpy (char *str) -{ - char *cp; - size_t len; - - len = strlen(str) + 1; - cp = mh_xmalloc(len); - - memcpy (cp, str, len); - return cp; -}