From: Howard Chu Date: Tue, 10 Sep 2002 03:13:37 +0000 (+0000) Subject: Eliminate overallocation in LUTIL_BASE64_ENCODE_LEN X-Git-Tag: NO_SLAP_OP_BLOCKS~993 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1dbbccc3fe55aafe032c3eb4fe53d0d5d8774a7e;p=openldap Eliminate overallocation in LUTIL_BASE64_ENCODE_LEN --- 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 */