moriyoshi               Tue Jul 20 16:08:08 2004 EDT

  Modified files:              
    /php-src/ext/ctype  ctype.c 
  Log:
  - Correct range checks.
  - Normalize negative values.
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.30&r2=1.31&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.30 php-src/ext/ctype/ctype.c:1.31
--- php-src/ext/ctype/ctype.c:1.30      Mon Jul 19 21:03:16 2004
+++ php-src/ext/ctype/ctype.c   Tue Jul 20 16:08:08 2004
@@ -97,9 +97,11 @@
                return; \
        switch (Z_TYPE_P(c)) { \
        case IS_LONG: \
-               if (Z_LVAL_P(c) < 255 && Z_LVAL_P(c) > -127) {  \
+               if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
                        RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
-               }       \
+               } else if (Z_LVAL_P(c) >= -128) { \
+                       RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
+               } \
                SEPARATE_ZVAL(&c);      \
                convert_to_string(c);   \
        case IS_STRING: \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to