From: Eric Andersen Date: Fri, 23 Mar 2001 17:10:19 +0000 (-0000) Subject: xstrdup tftp cleanup from Jeff Garzik X-Git-Tag: 0_51~93 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6b2c23d847a0942e6dcc5735a5a5512ab1432d28;p=oweals%2Fbusybox.git xstrdup tftp cleanup from Jeff Garzik --- diff --git a/networking/tftp.c b/networking/tftp.c index e4e01b9a2..309df36b3 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv) serverfile = cp + 1; - if ((s = strdup(serverstr))) { - s[cp - serverstr] = '\0'; + s = xstrdup(serverstr); + s[cp - serverstr] = '\0'; - if ((host = gethostbyname(s))) { - bad = 0; - } + if ((host = gethostbyname(s))) { + bad = 0; } free(s); diff --git a/tftp.c b/tftp.c index e4e01b9a2..309df36b3 100644 --- a/tftp.c +++ b/tftp.c @@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv) serverfile = cp + 1; - if ((s = strdup(serverstr))) { - s[cp - serverstr] = '\0'; + s = xstrdup(serverstr); + s[cp - serverstr] = '\0'; - if ((host = gethostbyname(s))) { - bad = 0; - } + if ((host = gethostbyname(s))) { + bad = 0; } free(s);