X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_message.c;h=3141065f8353466ff9edb9003a0400397daa2ed3;hp=70dcae82c933e68c9927b1dd5ed404a61b086e07;hb=906ccdd174554232371d4f50db47e0817fd91789;hpb=9f8096ebef03a968e8fe3250317a35ed3ebb7a5b diff --git a/php_http_message.c b/php_http_message.c index 70dcae8..3141065 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -940,6 +940,7 @@ static HashTable *php_http_message_object_get_props(zval *object TSRMLS_DC) HashTable *props = zend_get_std_object_handlers()->get_properties(object TSRMLS_CC); zval array, *parent, *body; char *version; + int verlen; PHP_HTTP_MESSAGE_OBJECT_INIT(obj); INIT_PZVAL_ARRAY(&array, props); @@ -963,7 +964,8 @@ static HashTable *php_http_message_object_get_props(zval *object TSRMLS_DC) } while(0) ASSOC_PROP(long, "type", obj->message->type); - ASSOC_STRINGL_EX("httpVersion", version, spprintf(&version, 0, "%u.%u", obj->message->http.version.major, obj->message->http.version.minor), 0); + verlen = spprintf(&version, 0, "%u.%u", obj->message->http.version.major, obj->message->http.version.minor); + ASSOC_STRINGL_EX("httpVersion", version, verlen, 0); switch (obj->message->type) { case PHP_HTTP_REQUEST: