summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-17 14:25:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-17 14:25:33 -0800
commit724379f56f57b60964bba32ea0e2cad47acdde60 (patch)
tree1a44b034e9b877e848e3ac4fcf67fd41935f900e
parent8d08bb2d2251ad282d020c6a136238cb314bbe60 (diff)
Use system strdup() instead of hand-coded Strdup()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--server.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/server.c b/server.c
index 9de968c..3d2fb26 100644
--- a/server.c
+++ b/server.c
@@ -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;