]> granicus.if.org Git - curl/commitdiff
made the code deal with empty name and password
authorDaniel Stenberg <daniel@haxx.se>
Fri, 17 Oct 2003 09:26:28 +0000 (09:26 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 17 Oct 2003 09:26:28 +0000 (09:26 +0000)
lib/ftp.c

index 41ef3089f13d4c0fc737d9f31d525a136ad2d6d8..6ee81b5d20e4df7c53505af012c875c2cd22a753 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -483,7 +483,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
 #endif
   
   /* send USER */
-  FTPSENDF(conn, "USER %s", ftp->user);
+  FTPSENDF(conn, "USER %s", ftp->user?ftp->user:"");
 
   /* wait for feedback */
   result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
@@ -499,7 +499,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
   else if(ftpcode == 331) {
     /* 331 Password required for ...
        (the server requires to send the user's password too) */
-    FTPSENDF(conn, "PASS %s", ftp->passwd);
+    FTPSENDF(conn, "PASS %s", ftp->passwd?ftp->passwd:"");
     result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
     if(result)
       return result;