Eliminated seeks so that we work correctly on pipes, and removed reliance on
[oweals/busybox.git] / tftp.c
diff --git a/tftp.c b/tftp.c
index e4e01b9a2f780cd90dfb3f8746408891044a0e68..466851c1b33748b88f8b604f6c6171e3edccfdf7 100644 (file)
--- a/tftp.c
+++ b/tftp.c
@@ -116,7 +116,7 @@ static inline int tftp(int cmd, struct hostent *host,
        len = sizeof(sa);
 
        memset(&sa, 0, len);
-       bind(socketfd, &sa, len);
+       bind(socketfd, (struct sockaddr *)&sa, len);
 
        sa.sin_family = host->h_addrtype;
        sa.sin_port = htons(port);
@@ -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);