php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch zip_stream_errors_reported.patch for Zip Related Bug #49072

Patch version 2011-02-01 12:20 UTC

Return to Bug #49072 | Download this patch
Patch Revisions:

Developer: rquadling@php.net

Index: zip_stream.c
===================================================================
--- zip_stream.c	(revision 307900)
+++ zip_stream.c	(working copy)
@@ -30,11 +30,11 @@
 /* {{{ php_zip_ops_read */
 static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
 {
-	size_t n = 0;
+	int n = 0;
 	STREAM_DATA_FROM_STREAM();
 
 	if (self->za && self->zf) {
-		n = (size_t)zip_fread(self->zf, buf, (int)count);
+		n = zip_fread(self->zf, buf, (int)count);
 		if (n < 0) {
 			int ze, se;
 			zip_file_error_get(self->zf, &ze, &se);
@@ -42,7 +42,7 @@
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
 			return 0;
 		}
-		if (n == 0 || n < count) {
+		if (n == 0 || n < (int)count) {
 			stream->eof = 1;
 		} else {
 			self->cursor += n;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 19:01:29 2024 UTC