attempt to fix #91
authorMichael Wallner <mike@php.net>
Fri, 2 Aug 2019 11:15:33 +0000 (13:15 +0200)
committerMichael Wallner <mike@php.net>
Fri, 2 Aug 2019 11:16:25 +0000 (13:16 +0200)
src/php_http_message_body.c

index 79c8bf7..b2e643b 100644 (file)
@@ -214,7 +214,7 @@ size_t php_http_message_body_append(php_http_message_body_t *body, const char *b
        written = php_stream_write(s, buf, len);
 
        if (written != len) {
-               php_error_docref(NULL, E_WARNING, "Failed to append %zu bytes to body; wrote %zu", len, written);
+               php_error_docref(NULL, E_WARNING, "Failed to append %zu bytes to body; wrote %zu", len, written == (size_t) -1 ? 0 : written);
        }
 
        return len;