From: Howard Chu Date: Thu, 6 Dec 2007 16:54:47 +0000 (+0000) Subject: Cleanup dup_compare X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~343 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f7ec966aade7d501ccd16c4939bf24ae1af7d969;p=openldap Cleanup dup_compare --- diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index bddbe79283..d4462365ce 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -468,11 +468,11 @@ hdb_dup_compare( cn = (diskNode *)curkey->data; /* data is not aligned, cannot compare directly */ - ul = un->nrdnlen[0] << 8 | un->nrdnlen[1]; - cl = cn->nrdnlen[0] << 8 | cn->nrdnlen[1]; + rc = un->nrdnlen[0] - cn->nrdnlen[0]; + if ( rc ) return rc; + rc = un->nrdnlen[1] - cn->nrdnlen[1]; + if ( rc ) return rc; - rc = ul - cl; - if( rc ) return rc; return strcmp( un->nrdn, cn->nrdn ); }