Remove code for protocols we don't properly support. (Most of this could
[oweals/busybox.git] / networking / wget.c
index 9c7ed9f1de299aa265c9bf350a13e031cc224caa..90ab48f9b5016d6025be195de99e96bdfcf064b8 100644 (file)
@@ -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