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 79c8bf765095852bd2798cf1ae80e077a287de12..b2e643be4b39491f4b4f90865e76edd530cdf06c 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;