From: Kurt Zeilenga Date: Sun, 25 Oct 1998 18:57:03 +0000 (+0000) Subject: Apply Ken McGarrahan's ldif padding fix. X-Git-Tag: PHP3_TOOL_0_0~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ded2194df73c31bd63c34588c7b6c686b20f1c08;p=openldap Apply Ken McGarrahan's ldif padding fix. --- 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)++ = '='; + } } } }