From 1dbbccc3fe55aafe032c3eb4fe53d0d5d8774a7e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 10 Sep 2002 03:13:37 +0000 Subject: [PATCH] Eliminate overallocation in LUTIL_BASE64_ENCODE_LEN --- include/lutil.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lutil.h b/include/lutil.h index cae38a3430..339a4ad384 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -23,9 +23,9 @@ LDAP_BEGIN_DECL /* n octets encode into ceiling(n/3) * 4 bytes */ -/* Avoid floating point math by through extra padding */ +/* Avoid floating point math through extra padding */ -#define LUTIL_BASE64_ENCODE_LEN(n) ((n)/3 * 4 + 4) +#define LUTIL_BASE64_ENCODE_LEN(n) (((n)+2)/3 * 4) #define LUTIL_BASE64_DECODE_LEN(n) (((n)+3)/4 * 3) /* ISC Base64 Routines */ -- 2.39.5