summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2004-07-20 20:10:04 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2004-07-20 20:10:04 +0000
commit1802b2c9ddf2799d678f5ac5503008f596cd9442 (patch)
treed98263e98d2b3daee6326d8fb4ab1984efe628d9
parente3a480faf8a24f020707df4db19509ff389f7578 (diff)
downloadphp-git-1802b2c9ddf2799d678f5ac5503008f596cd9442.tar.gz
- MFH (ctype.c: 1.31): Correct range checks.
- MFH (ctype.c: 1.31): Normalize negative values.
-rw-r--r--ext/ctype/ctype.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 0291979010..8336283a42 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -97,9 +97,11 @@ PHP_MINFO_FUNCTION(ctype)
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: \