Document that EVP_EncodeBlock writes a trailing NUL.
Fix base64_test.c to account for this.
Change-Id: I0b3e8062a2130fb01a7e6f175968484769c406f9
Reviewed-on: https://boringssl-review.googlesource.com/1250
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/base64.h b/include/openssl/base64.h
index c4d312c..52dfd6d 100644
--- a/include/openssl/base64.h
+++ b/include/openssl/base64.h
@@ -94,8 +94,9 @@
* sets |*out_len| to the number of bytes written. */
void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len);
-/* EVP_EncodeBlock encodes |src_len| bytes from |src| and writes the result to
- * |dst|. It returns the number of bytes written. */
+/* EVP_EncodeBlock encodes |src_len| bytes from |src| and writes the
+ * result to |dst| with a trailing NUL. It returns the number of bytes
+ * written, not including this trailing NUL. */
size_t EVP_EncodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len);