X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Futils.c;h=510dd2fc197937d4d0c0ccc7ababa90271656c6a;hb=refs%2Fheads%2F1.1-ed25519;hp=dca88d6dc812356426b599f460dba304deb19d31;hpb=c3d357af6c73d538f7cbcaca293ebbca666d3a82;p=tinc diff --git a/src/utils.c b/src/utils.c index dca88d6d..510dd2fc 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,7 +1,7 @@ /* utils.c -- gathering of some stupid small functions Copyright (C) 1999-2005 Ivo Timmermans - 2000-2012 Guus Sliepen + 2000-2013 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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;