Fix some warnings in allbareconfig.
[oweals/busybox.git] / networking / wget.c
index 6c6a8a7cfee298614c053ac96e99d7356b3f25ca..fdcc68df31ffcb5459e03af70e4445861c4770b8 100644 (file)
 #include <unistd.h>
 #include <ctype.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 #include <signal.h>
 #include <sys/ioctl.h>
 
-#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -238,7 +238,7 @@ int wget_main(int argc, char **argv)
        if (!fname_out) {
                // Dirty hack. Needed because bb_get_last_path_component
                // will destroy trailing / by storing '\0' in last byte!
-               if(target.path[strlen(target.path)-1]!='/') {
+               if(*target.path && target.path[strlen(target.path)-1]!='/') {
                        fname_out =
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
                                curfile =
@@ -853,13 +853,3 @@ progressmeter(int flag)
  *
  *     $Id: wget.c,v 1.75 2004/10/08 08:27:40 andersen Exp $
  */
-
-
-
-/*
-Local Variables:
-c-file-style: "linux"
-c-basic-offset: 4
-tab-width: 4
-End:
-*/