]> sjero.net Git - wget/blobdiff - src/http-ntlm.c
[svn] Fix setting the NTLM domain.
[wget] / src / http-ntlm.c
index 6e35cbbe50e8c116ba9e0afba84fde3c7a26dfb7..91ca02801b0db622d570aab84df21c34ca8fe910 100644 (file)
@@ -378,7 +378,7 @@ char *ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
     size = 32 + hostlen + domlen;
 
     base64 = (char *) alloca (BASE64_LENGTH (size) + 1);
-    base64_encode (ntlmbuf, base64, size);
+    base64_encode (ntlmbuf, size, base64);
 
     output = concat_strings ("NTLM ", base64, (char *) 0);
     break;
@@ -417,7 +417,7 @@ char *ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
       usr = strchr(user, '/');
 
     if (usr) {
-      domain = usr;
+      domain = user;
       domlen = usr - domain;
       usr++;
     }
@@ -538,7 +538,7 @@ char *ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
 
     /* convert the binary blob into base64 */
     base64 = (char *) alloca (BASE64_LENGTH (size) + 1);
-    base64_encode (ntlmbuf, base64, size);
+    base64_encode (ntlmbuf, size, base64);
 
     output = concat_strings ("NTLM ", base64, (char *) 0);