From: Daniel Stenberg Date: Mon, 20 Oct 2003 20:30:40 +0000 (+0000) Subject: allow no user and no passwd when doing basic auth X-Git-Tag: curl-7_10_8~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d6584e1407ad3c4a067515faf431c15e698103b;p=thirdparty%2Fcurl.git allow no user and no passwd when doing basic auth --- diff --git a/lib/http.c b/lib/http.c index 9e2196ab28..95e06ecf86 100644 --- a/lib/http.c +++ b/lib/http.c @@ -125,7 +125,9 @@ static CURLcode Curl_output_basic(struct connectdata *conn) char *authorization; struct SessionHandle *data=conn->data; - sprintf(data->state.buffer, "%s:%s", conn->user, conn->passwd); + sprintf(data->state.buffer, "%s:%s", + conn->user?conn->user:"", + conn->passwd?conn->passwd:""); if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer), &authorization) >= 0) { if(conn->allocptr.userpwd)