mdbx++: fix to_base64::write_bytes() for tail bytes.

Change-Id: I60defa11b7e44dcf2ac840160ab0c833484c9d39
This commit is contained in:
Leonid Yuriev 2022-01-15 17:22:18 +03:00
parent 2151be6cde
commit 51e6d4645c

View File

@ -877,13 +877,13 @@ char *to_base64::write_bytes(char *__restrict dest, size_t dest_size) const {
}
continue;
case 2:
b64_3to4(src[0], 0, 0, dest);
dest[2] = dest[3] = '=';
return dest + 4;
case 1:
b64_3to4(src[0], src[1], 0, dest);
dest[3] = '=';
return dest + 4;
case 1:
b64_3to4(src[0], 0, 0, dest);
dest[2] = dest[3] = '=';
return dest + 4;
case 0:
return dest;
}