sander Fri Oct 11 08:42:02 2002 EDT Modified files: /php4/ext/standard string.c Log: Fixed problems with the new nl2br() and beautified the code a little. Closes #19858. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.322 php4/ext/standard/string.c:1.323 --- php4/ext/standard/string.c:1.322 Thu Oct 10 23:19:38 2002 +++ php4/ext/standard/string.c Fri Oct 11 08:42:01 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.322 2002/10/11 03:19:38 iliaa Exp $ */ +/* $Id: string.c,v 1.323 2002/10/11 12:42:01 sander Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3061,10 +3061,10 @@ } if (repl_cnt == 0) { - RETURN_STRINGL(str, Z_STRLEN_PP(zstr), 1); + RETURN_STRINGL(Z_STRVAL_PP(zstr), Z_STRLEN_PP(zstr), 1); } - new_length = Z_STRLEN_PP(zstr) + repl_cnt * 6; + new_length = Z_STRLEN_PP(zstr) + repl_cnt * (sizeof("<br />") - 1); tmp = target = emalloc(new_length + 1); str = Z_STRVAL_PP(zstr); @@ -3091,7 +3091,7 @@ str++; } - *target = 0; + *target = '\0'; RETURN_STRINGL(tmp, new_length, 0); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php