From: Guus Sliepen Date: Sun, 6 Apr 2014 20:46:06 +0000 (+0200) Subject: Fix return value of b64encode(). X-Git-Tag: release-1.1pre11~126^2~1 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=d6734a2da483675f5bcc9cf7b15723a409b1019f;p=tinc Fix return value of b64encode(). --- diff --git a/src/utils.c b/src/utils.c index edaa354f..510dd2fc 100644 --- a/src/utils.c +++ b/src/utils.c @@ -112,14 +112,14 @@ static int b64encode_internal(const char *src, char *dst, int length, const char dst[di + 1] = alphabet[triplet & 63]; triplet >>= 6; dst[di + 2] = alphabet[triplet]; dst[di + 3] = 0; - length = di + 2; + length = di + 3; break; case 1: triplet = usrc[si]; dst[di] = alphabet[triplet & 63]; triplet >>= 6; dst[di + 1] = alphabet[triplet]; dst[di + 2] = 0; - length = di + 1; + length = di + 2; break; default: dst[di] = 0;