From ded2194df73c31bd63c34588c7b6c686b20f1c08 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 25 Oct 1998 18:57:03 +0000 Subject: [PATCH] Apply Ken McGarrahan's ldif padding fix. --- libraries/libldif/line64.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index 2a3a1708f1..429e1d6ab1 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -276,12 +276,12 @@ put_type_and_value( char **out, char *t, char *val, int vlen ) len = 1; } - /* get b64 digit from low order 6 bits */ - *(*out)++ = nib2b64[ (bits & 0xfc0000L) >> 18 ]; - } - - for ( ; pad > 0; pad-- ) { - *(*out - pad) = '='; + if( i + pad < 4 ) { + /* get b64 digit from low order 6 bits */ + *(*out)++ = nib2b64[ (bits & 0xfc0000L) >> 18 ]; + } else { + *(*out)++ = '='; + } } } } -- 2.39.5