X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_headers_api.c;h=63c46abad58a8d23f2a9004ee568e9f7227062cd;hp=e320f46b8ca2864e108c70d425464361ef86a7da;hb=dd18f054d481e2d24f766db8f36e8e721950d68c;hpb=60d91c35d7c2b4ce86ed67813f2f5a19266a30cc diff --git a/http_headers_api.c b/http_headers_api.c index e320f46..63c46ab 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -154,7 +154,7 @@ PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *support while (*++ptr && !isdigit(*ptr)); - quality = strtod(ptr, NULL); + quality = atof(ptr); identifier = estrndup(Z_STRVAL_PP(entry), separator - Z_STRVAL_PP(entry)); } else { quality = 1000.0 - i++; @@ -331,7 +331,8 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header size_t header_len; zval array; - Z_ARRVAL(array) = headers; + INIT_ZARR(array, headers); + if (body) { header_len = body - header; } else { @@ -341,7 +342,7 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header while (header_len >= (size_t) (line - begin)) { int value_len = 0; - + /* note: valgrind may choke on that -- should be safe though */ switch (*line++) { case ':':