From: Remi Collet Date: Wed, 3 Sep 2014 13:31:33 +0000 (+0200) Subject: fix httpVersion retrieval on bigendian X-Git-Tag: RELEASE_2_2_0_RC1~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=906ccdd174554232371d4f50db47e0817fd91789;p=m6w6%2Fext-http fix httpVersion retrieval on bigendian --- 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: