cvs: /php4/ext/standard string.c

From: Date: Sun, 13 Feb 2000 15:56:37 +0000
Subject: cvs: /php4/ext/standard string.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-10221@lists.php.net to get a copy of this message
andi Sun Feb 13 07:56:37 2000 EDT Modified files: /php4/ext/standard string.c Log: - Beautify a bit. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.98 php4/ext/standard/string.c:1.99 --- php4/ext/standard/string.c:1.98 Sun Feb 13 07:35:51 2000 +++ php4/ext/standard/string.c Sun Feb 13 07:56:07 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.98 2000/02/13 15:35:51 zeev Exp $ */ +/* $Id: string.c,v 1.99 2000/02/13 15:56:07 andi Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2149,7 +2149,7 @@ int php_tag_find(char *tag, int len, char *set) { char c, *n, *t; int i=0, state=0, done=0; - char *norm = emalloc(len); + char *norm = emalloc(len+1); n = norm; t = tag; @@ -2184,8 +2184,11 @@ } *(n++) = '>'; *n = '\0'; - if(strstr(set,norm)) done=1; - else done=0; + if(strstr(set,norm)) { + done=1; + } else { + done=0; + } efree(norm); return done; } @@ -2265,8 +2268,8 @@ if(allow) { *(tp++) = '>'; *tp='\0'; - if(php_tag_find(tbuf, tp-tbuf+1, allow)) { - memcpy(rp,tbuf,tp-tbuf+1); + if(php_tag_find(tbuf, tp-tbuf, allow)) { + memcpy(rp,tbuf,tp-tbuf); rp += tp-tbuf; } tp = tbuf;

« previous php.version4 (#10221) next »