]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#2055, avoid roundoff errors in LUTIL_BASE64_DECODE_LEN
authorHoward Chu <hyc@openldap.org>
Tue, 10 Sep 2002 02:55:05 +0000 (02:55 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 10 Sep 2002 02:55:05 +0000 (02:55 +0000)
include/lutil.h

index 4a53306b814cd3a12144a95572c70bdf4eb68324..cae38a34303ee59edfc23a69779e59413602b406 100644 (file)
@@ -26,7 +26,7 @@ LDAP_BEGIN_DECL
 /* Avoid floating point math by 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_DECODE_LEN(n)     (((n)+3)/4 * 3)
 
 /* ISC Base64 Routines */
 /* base64.c */