X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_api.c;h=d175201913996af652c287015b218d1de52c1842;hb=391976a207cfc3effffa0bdbfa14829eb753e9aa;hp=fdb0812bf480110edbe593dfdff6b3c102e579a5;hpb=0e41acb9661b95484c212e349f83e34eb3fe84a2;p=m6w6%2Fext-http diff --git a/http_message_api.c b/http_message_api.c index fdb0812..d175201 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -160,7 +160,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char char *tmp; int tmp_len; - tmp_len = (int) spprintf(&tmp, 0, "%lu", (ulong) decoded_len); + tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); MAKE_STD_ZVAL(len); ZVAL_STRINGL(len, tmp, tmp_len, 0); @@ -188,7 +188,8 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char if (c = http_message_header(msg, "Content-Range")) { ulong total = 0, start = 0, end = 0, len = 0; - if (!strncasecmp(Z_STRVAL_P(c), "bytes=", lenof("bytes="))) { + if (!strncasecmp(Z_STRVAL_P(c), "bytes", lenof("bytes")) && + (Z_STRVAL_P(c)[lenof("bytes")] == '=' || Z_STRVAL_P(c)[lenof("bytes")] == ' ')) { char *total_at = NULL, *end_at = NULL; char *start_at = Z_STRVAL_P(c) + lenof("bytes="); @@ -264,7 +265,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char char *tmp; int tmp_len; - tmp_len = (int) spprintf(&tmp, 0, "%lu", (ulong) decoded_len); + tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); MAKE_STD_ZVAL(len); ZVAL_STRINGL(len, tmp, tmp_len, 0);