diff options
author | bptato <nincsnevem662@gmail.com> | 2021-02-02 22:59:42 +0000 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-02-02 22:59:42 +0000 |
commit | d277e80771a1a5cae19d21bfd895b4e16b3ca959 (patch) | |
tree | 75bc8141a757015177d33fbcd2f3758869d6f1f5 /file.c | |
parent | Support iTerm2 graphics protocol, replace encodeB with base64_encode (diff) | |
download | w3m-d277e80771a1a5cae19d21bfd895b4e16b3ca959.tar.gz w3m-d277e80771a1a5cae19d21bfd895b4e16b3ca959.zip |
Some cleanup for base64_encode
Diffstat (limited to '')
-rw-r--r-- | file.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1175,7 +1175,11 @@ AuthBasicCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu, Str s = Strdup(uname); Strcat_char(s, ':'); Strcat(s, pw); - return Strnew_m_charp("Basic ", base64_encode(s->ptr, s->length), NULL); + char *base64 = base64_encode(s->ptr, s->length); + if (!base64) + return Strnew_charp("Basic "); + else + return Strnew_m_charp("Basic ", base64, NULL); } #ifdef USE_DIGEST_AUTH |