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);
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=");
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);