CVS update: php3/functions

From: Date: Wed, 12 May 1999 12:52:04 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5566@lists.php.net to get a copy of this message
Date: Wednesday May 12, 1999 @ 8:52 Author: rasmus Update of /repository/php3/functions In directory php:/tmp/cvs-serv5489/functions Modified Files: string.c Log Message: Oops, make sure returned string is the right length Index: php3/functions/string.c diff -u php3/functions/string.c:1.188 php3/functions/string.c:1.189 --- php3/functions/string.c:1.188 Wed May 12 08:37:55 1999 +++ php3/functions/string.c Wed May 12 08:52:03 1999 @@ -30,7 +30,7 @@ */ -/* $Id: string.c,v 1.188 1999/05/12 12:37:55 rasmus Exp $ */ +/* $Id: string.c,v 1.189 1999/05/12 12:52:03 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -885,8 +885,9 @@ RETURN_FALSE; } - if ((f + l) < (int)string->value.str.len) { - string->value.str.val[f + l] = '\0'; + /* Adjust l to match the actual string segment to be returned */ + if((f+l) > (int)string->value.str.len) { + l = (int)string->value.str.len - f; } RETVAL_STRINGL(string->value.str.val + f,l,1); } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5566) next »