diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2020-11-17 14:25:33 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2020-11-17 14:25:33 -0800 |
commit | 724379f56f57b60964bba32ea0e2cad47acdde60 (patch) | |
tree | 1a44b034e9b877e848e3ac4fcf67fd41935f900e | |
parent | 8d08bb2d2251ad282d020c6a136238cb314bbe60 (diff) |
Use system strdup() instead of hand-coded Strdup()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | server.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -43,7 +43,6 @@ #define FALSE 0 static void squish_out_escapes(char *s); -static char *Strdup(char *s); static int get_a_line(FILE *f, int *pargc, char ***pargv); static char *Strlwr(char *s0); static void do_it(void); @@ -172,18 +171,6 @@ squish_out_escapes(char *s) *o = '\0'; } -static char * -Strdup(char *s) -{ - char *cs; - - if (!s) - return s; - cs = malloc(strlen(s)+1); - strcpy(cs, s); - return cs; -} - static int get_a_line(FILE *f, int *pargc, char ***pargv) { @@ -216,7 +203,7 @@ get_a_line(FILE *f, int *pargc, char ***pargv) } *p = '\0'; - saved = Strdup(buf); + saved = strdup(buf); if(!saved) nomem(); *pargc = 0; @@ -471,7 +458,7 @@ odt1_display_hack(char *s) he->h_addr_list[0][2] & 0xff, he->h_addr_list[0][3] & 0xff, p); - s = Strdup(buf); + s = strdup(buf); if(!s) nomem(); putenv(s); return TRUE; |