xstrdup tftp cleanup from Jeff Garzik

This commit is contained in:
Eric Andersen 2001-03-23 17:10:19 +00:00
parent 21af752b04
commit 6b2c23d847
2 changed files with 8 additions and 10 deletions

View File

@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv)
serverfile = cp + 1; serverfile = cp + 1;
if ((s = strdup(serverstr))) { s = xstrdup(serverstr);
s[cp - serverstr] = '\0'; s[cp - serverstr] = '\0';
if ((host = gethostbyname(s))) { if ((host = gethostbyname(s))) {
bad = 0; bad = 0;
}
} }
free(s); free(s);

9
tftp.c
View File

@ -387,12 +387,11 @@ int tftp_main(int argc, char **argv)
serverfile = cp + 1; serverfile = cp + 1;
if ((s = strdup(serverstr))) { s = xstrdup(serverstr);
s[cp - serverstr] = '\0'; s[cp - serverstr] = '\0';
if ((host = gethostbyname(s))) { if ((host = gethostbyname(s))) {
bad = 0; bad = 0;
}
} }
free(s); free(s);