summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/tftp.c9
-rw-r--r--tftp.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index e4e01b9..309df36 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 e4e01b9..309df36 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);