X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=libcitadel%2Flib%2Fbase64.c;fp=libcitadel%2Flib%2Fbase64.c;h=b607c98f5f4f797c76f62c6044052face75ac671;hp=ef1e01e714124f1fdd35c64a51d2fd3e7511b89e;hb=9f197d0b63b09d6cc295051016a5b549a65e8588;hpb=c552978c0ea0ab081a32d7c29ba62d4c0e8aad60 diff --git a/libcitadel/lib/base64.c b/libcitadel/lib/base64.c index ef1e01e71..b607c98f5 100644 --- a/libcitadel/lib/base64.c +++ b/libcitadel/lib/base64.c @@ -5,7 +5,7 @@ // and I don't want to fix it again. I don't care how many nanoseconds you think // you can shave off the execution time. Don't fucking touch it. // -// Copyright (c) 1987-2022 by the citadel.org team +// Copyright (c) 1987-2024 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. @@ -121,6 +121,11 @@ char b64unalphabet(char ch) { // source Source base64-encoded buffer // source_len Stop after parsing this many bytes // return value Decoded length + +// AWESOME SAUCE ALERT: +// It is legal to specify the same pointer for the source and destination buffers. +// If you do so, the string will be "decoded in place". + size_t CtdlDecodeBase64(char *dest, const char *source, size_t source_len) { size_t bytes_read = 0; size_t bytes_decoded = 0;