]> diplodocus.org Git - nmh/commitdiff
Delete client_getcpy(); don't know why it exists.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 16 Oct 2016 23:32:46 +0000 (00:32 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 16 Oct 2016 23:32:46 +0000 (00:32 +0100)
Replace with calls to getcpy() or mh_xstrdup().

sbr/client.c

index 7417ed54c06f0a40fad5aefdf9e8fd7dd0359966..6695e084e59e802a8e09f6808032d446ce526ea4 100644 (file)
@@ -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_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 **);
 
 
 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 = 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, 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, MAXARGS);
     }
     if (ap == arguments) {
-       *ap++ = client_getcpy ("localhost");
+       *ap++ = mh_xstrdup("localhost");
        *ap = NULL;
     }
 
        *ap = NULL;
     }
 
@@ -190,17 +189,3 @@ client_copyip (char **p, char **q, int len_q)
 
     return 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;
-}