cvs: php4 /ext/standard string.c
| From: | Stanislav Malyshev | Date: | Thu, 17 Aug 2000 08:47:42 +0000 |
| Subject: | cvs: php4 /ext/standard string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1202@lists.php.net to get a copy of this message | ||
stas Thu Aug 17 01:47:42 2000 EDT
Modified files:
/php4/ext/standard string.c
Log:
Fix chunk_split (#6208)
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.143 php4/ext/standard/string.c:1.144
--- php4/ext/standard/string.c:1.143 Sun Aug 6 07:36:10 2000
+++ php4/ext/standard/string.c Thu Aug 17 01:47:42 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.143 2000/08/06 14:36:10 eschmid Exp $ */
+/* $Id: string.c,v 1.144 2000/08/17 08:47:42 stas Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1040,11 +1040,15 @@
convert_to_string_ex(p_str);
}
- if(chunklen == 0) {
- php_error(E_WARNING, "chunk length is 0");
+ if(chunklen <= 0) {
+ php_error(E_WARNING, "Chunk length should be greater than zero");
RETURN_FALSE;
}
-
+
+ if((*p_str)->value.str.len == 0) {
+ RETURN_EMPTY_STRING();
+ }
+
result = php_chunk_split((*p_str)->value.str.val, (*p_str)->value.str.len,
end, endlen, chunklen, &result_len);