]> git.sur5r.net Git - openldap/commitdiff
Eliminate overallocation in LUTIL_BASE64_ENCODE_LEN
authorHoward Chu <hyc@openldap.org>
Tue, 10 Sep 2002 03:13:37 +0000 (03:13 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 10 Sep 2002 03:13:37 +0000 (03:13 +0000)
include/lutil.h

index cae38a34303ee59edfc23a69779e59413602b406..339a4ad384cccff5224091f60accf5bc207012ce 100644 (file)
@@ -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 */