From: Jann Horn Date: Sat, 27 Jul 2013 10:21:23 +0000 (+0200) Subject: fix base64: add terminating nullbyte X-Git-Url: http://git.thejh.net/?p=libjh.git;a=commitdiff_plain;h=c1adc4723f53f078f27951a95cd8b5aa8fd98367 fix base64: add terminating nullbyte --- diff --git a/base64.c b/base64.c index 3d70903..2ad5eb7 100644 --- a/base64.c +++ b/base64.c @@ -12,7 +12,7 @@ static char b64_encchr(unsigned char c) { // hold the base64-encoded form of the input. PUBLIC_FN void base64_encode(char *dst, unsigned char *src, size_t len) { start:; - if (len == 0) return; + if (len == 0) { *dst = '\0'; return; } unsigned char a=src[0], b=0, c=0; len--, src++; int eqsigns = (len<2)?(2-len):0;