From 2504f29a0c8a7b098c72f76db2f0b9846d1bfcad Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 23 Oct 2000 18:04:45 +0000 Subject: [PATCH] Fix IS ASCII checks. Should be < 0x80 (0100), not < 0x100. --- include/ldap_pvt_uc.h | 2 +- libraries/libldap/utf-8.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ldap_pvt_uc.h b/include/ldap_pvt_uc.h index 5b4bcc06ed..bfd236ef05 100644 --- a/include/ldap_pvt_uc.h +++ b/include/ldap_pvt_uc.h @@ -82,7 +82,7 @@ LDAP_F (char *) ldap_utf8_strpbrk( const char* str, const char *set); LDAP_F (char*) ldap_utf8_strtok( char* sp, const char* sep, char **last); /* Optimizations */ -#define LDAP_UTF8_ISASCII(p) ( * (const unsigned char *) (p) < 0x100 ) +#define LDAP_UTF8_ISASCII(p) ( * (const unsigned char *) (p) < 0x80 ) #define LDAP_UTF8_CHARLEN(p) ( LDAP_UTF8_ISASCII(p) \ ? 1 : ldap_utf8_charlen((p)) ) #define LDAP_UTF8_OFFSET(p) ( LDAP_UTF8_ISASCII(p) \ diff --git a/libraries/libldap/utf-8.c b/libraries/libldap/utf-8.c index 1523b7b4a4..70734d7504 100644 --- a/libraries/libldap/utf-8.c +++ b/libraries/libldap/utf-8.c @@ -29,7 +29,7 @@ #include "ldap_defaults.h" #undef ISASCII -#define ISASCII(uc) ((uc) < 0x100) +#define ISASCII(uc) ((uc) < 0x80) /* * Basic UTF-8 routines @@ -264,7 +264,7 @@ int ldap_utf8_copy( char* dst, const char *src ) /* * UTF-8 ctype routines - * Only deals with characters < 0x100 (ie: US-ASCII) + * Only deals with characters < 0x80 (ie: US-ASCII) */ int ldap_utf8_isascii( const char * p ) -- 2.39.5