Re: com php-src: fix for bug#18556 - use simple tolower() function for internal things: Zend/zend_operators.c ext/standard/string.c
| From: | Nuno Lopes | Date: | Sun, 15 Jul 2012 03:15:31 +0000 |
| Subject: | Re: com php-src: fix for bug#18556 - use simple tolower() function for internal things: Zend/zend_operators.c ext/standard/string.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-69597@lists.php.net to get a copy of this message | ||
Hi,
Just a few minor nitpicks:
+static unsigned char tolower_map[256] = {This should be const.
+#define zend_tolower_ascii(c) (tolower_map[(c)])I suggest casting to unsigned char to prevent overflows and negative chars problems (128-255): #define zend_tolower_ascii(c) (tolower_map[(unsigned char)(c)])
+ *result++ = zend_tolower_ascii((int)*str++);The cast to int is not necessary. Same comment applies for most other calls. And thanks for fixing this ancient bug :) Nuno