From: Howard Chu Date: Tue, 25 Oct 2005 21:37:37 +0000 (+0000) Subject: ITS#4101 fgets leaves NL in input buffer X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~196 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=059e7c62ce8f7fa1214ae9476e552eeb547d8441;p=openldap ITS#4101 fgets leaves NL in input buffer --- diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index e87e13d7d7..d921fe736d 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -206,7 +206,7 @@ main(int argc, char **argv) if (havedn) retval = domodrdn( ld, entrydn, rdn, newSuperior, remove_old_RDN ); else while ((rc == 0 || contoper) && fgets(buf, sizeof(buf), fp) != NULL) { - if ( *buf != '\0' ) { /* blank lines optional, skip */ + if ( *buf != '\n' ) { /* blank lines optional, skip */ buf[ strlen( buf ) - 1 ] = '\0'; /* remove nl */ if ( havedn ) { /* have DN, get RDN */