Fix some warnings in allbareconfig.
[oweals/busybox.git] / networking / wget.c
index 9c7ed9f1de299aa265c9bf350a13e031cc224caa..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 =
@@ -332,11 +332,11 @@ int wget_main(int argc, char **argv)
 #ifdef CONFIG_FEATURE_WGET_AUTHENTICATION
                        if (target.user) {
                                fprintf(sfp, "Authorization: Basic %s\r\n",
-                                       base64enc(target.user, buf, sizeof(buf)));
+                                       base64enc((unsigned char*)target.user, buf, sizeof(buf)));
                        }
                        if (use_proxy && server.user) {
                                fprintf(sfp, "Proxy-Authorization: Basic %s\r\n",
-                                       base64enc(server.user, buf, sizeof(buf)));
+                                       base64enc((unsigned char*)server.user, buf, sizeof(buf)));
                        }
 #endif
 
@@ -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:
-*/