From: Howard Chu Date: Tue, 10 Sep 2002 03:16:50 +0000 (+0000) Subject: Import ITS#2055 fix from HEAD - LUTIL_BASE64 encode/decode lengths X-Git-Tag: OPENLDAP_REL_ENG_2_0_26~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4d87572226b3c4677ab2251acfd0af63542a2870;p=openldap Import ITS#2055 fix from HEAD - LUTIL_BASE64 encode/decode lengths --- diff --git a/include/lutil.h b/include/lutil.h index 5dcb7d97c3..5eff159b0b 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -23,10 +23,10 @@ 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_DECODE_LEN(n) ((n)/4 * 3) +#define LUTIL_BASE64_ENCODE_LEN(n) (((n)+2)/3 * 4) +#define LUTIL_BASE64_DECODE_LEN(n) (((n)+3)/4 * 3) /* ISC Base64 Routines */ /* base64.c */