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 /etc.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 'etc.c')
-rw-r--r-- | etc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2008,7 +2008,7 @@ void (*mySignal(int signal_number, void (*action) (int))) (int) { static char Base64Table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const char * +char * base64_encode(const unsigned char *src, int len) { unsigned char *w, *at; @@ -2021,9 +2021,9 @@ base64_encode(const unsigned char *src, int len) k = k / 3 * 4; if (k < len) - return ""; + return NULL; - w = GC_MALLOC_ATOMIC(k); + w = GC_MALLOC_ATOMIC(k + 1); w[k] = 0; at = w; @@ -2061,5 +2061,5 @@ base64_encode(const unsigned char *src, int len) *at++ = '='; } } - return w; + return (char *)w; } |