cvs: /php4/ext/standard string.c
| From: | Andi Gutmans | Date: | Sun, 13 Feb 2000 16:00:03 +0000 |
| Subject: | cvs: /php4/ext/standard string.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-10222@lists.php.net to get a copy of this message | ||
andi Sun Feb 13 08:00:03 2000 EDT
Modified files:
/php4/ext/standard string.c
Log:
- Not sure if len can be zero but it's better to check it once then
rechecking for it every loop and having an extra variable do nothing.
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.99 php4/ext/standard/string.c:1.100
--- php4/ext/standard/string.c:1.99 Sun Feb 13 07:56:07 2000
+++ php4/ext/standard/string.c Sun Feb 13 07:59:32 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.99 2000/02/13 15:56:07 andi Exp $ */
+/* $Id: string.c,v 1.100 2000/02/13 15:59:32 andi Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -2148,7 +2148,7 @@
*/
int php_tag_find(char *tag, int len, char *set) {
char c, *n, *t;
- int i=0, state=0, done=0;
+ int state=0, done=0;
char *norm = emalloc(len+1);
n = norm;
@@ -2159,7 +2159,10 @@
and turn any <a whatever...> into just <a> and any </tag>
into <tag>
*/
- while(i<len && !done) {
+ if (!len) {
+ return 0;
+ }
+ while(!done) {
switch(c) {
case '<':
*(n++) = c;