From 51e6d4645ce186d65e2a8200e8f324e865852cf4 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 15 Jan 2022 17:22:18 +0300 Subject: [PATCH] mdbx++: fix `to_base64::write_bytes()` for tail bytes. Change-Id: I60defa11b7e44dcf2ac840160ab0c833484c9d39 --- src/mdbx.c++ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 017057a2..0bb5f9fe 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -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; }