Awesome sauce, read description below for details.
[citadel.git] / libcitadel / lib / base64.c
index ef1e01e714124f1fdd35c64a51d2fd3e7511b89e..b607c98f5f4f797c76f62c6044052face75ac671 100644 (file)
@@ -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;