X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Futils.c;h=510dd2fc197937d4d0c0ccc7ababa90271656c6a;hb=49e3baec20ddad9cc297c3eeb1d13f0e421f69c8;hp=edaa354fdf905a08e9902be3cfd2cea9fe096aeb;hpb=5e00a24e1f13fa70a6945831c409d873b7809d11;p=tinc 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;