cvs: php4 /ext/standard string.c

From: Date: Tue, 22 Oct 2002 18:27:56 +0000
Subject: cvs: php4 /ext/standard string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-15154@lists.php.net to get a copy of this message
helly Tue Oct 22 14:27:56 2002 EDT Modified files: /php4/ext/standard string.c Log: Fix for cases when new_length is NULL Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.326 php4/ext/standard/string.c:1.327 --- php4/ext/standard/string.c:1.326 Fri Oct 18 09:07:50 2002 +++ php4/ext/standard/string.c Tue Oct 22 14:27:56 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.326 2002/10/18 13:07:50 andrei Exp $ */ +/* $Id: string.c,v 1.327 2002/10/22 18:27:56 helly Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2422,7 +2422,11 @@ char *new_str; char *source, *target; char *end; - + int local_new_length; + + if (!new_length) { + new_length = &local_new_length; + } if (!str) { *new_length = 0; return str; @@ -2471,9 +2475,7 @@ } *target = 0; - if (new_length) { - *new_length = target - new_str; - } + *new_length = target - new_str; if (should_free) { STR_FREE(str); }

« previous php.cvs (#15154) next »