[PHP4BETA] CVS update: php4/ext/standard

From: Date: Wed, 12 May 1999 12:53:45 +0000
Subject: [PHP4BETA] CVS update: php4/ext/standard
Groups: php.version4 
Request: Send a blank email to php-version4+get-783@lists.php.net to get a copy of this message
Date: Wednesday May 12, 1999 @ 8:53 Author: rasmus Update of /repository/php4/ext/standard In directory php:/tmp/cvs-serv5816/ext/standard Modified Files: string.c Log Message: substr() fix Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.10 php4/ext/standard/string.c:1.11 --- php4/ext/standard/string.c:1.10 Wed May 12 08:43:03 1999 +++ php4/ext/standard/string.c Wed May 12 08:53:45 1999 @@ -30,7 +30,7 @@ */ -/* $Id: string.c,v 1.10 1999/05/12 12:43:03 rasmus Exp $ */ +/* $Id: string.c,v 1.11 1999/05/12 12:53:45 rasmus Exp $ */ #include <stdio.h> #include "php.h" @@ -826,9 +826,10 @@ RETURN_FALSE; } - if ((f + l) < (int)string->value.str.len) { - string->value.str.val[f + l] = '\0'; + 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 4 Beta

« previous php.version4 (#783) next »