|
|
|
@ -69,7 +69,7 @@ static int vlc_http_file_req(const struct vlc_http_resource *res, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (vlc_http_msg_add_header(req, "Range", "bytes=%ju-", *offset) |
|
|
|
if (vlc_http_msg_add_header(req, "Range", "bytes=%" PRIuMAX "-", *offset) |
|
|
|
&& *offset != 0) |
|
|
|
return -1; |
|
|
|
return 0; |
|
|
|
@ -89,7 +89,7 @@ static int vlc_http_file_resp(const struct vlc_http_resource *res, |
|
|
|
goto fail; |
|
|
|
|
|
|
|
uintmax_t start, end; |
|
|
|
if (sscanf(str, "bytes %ju-%ju", &start, &end) != 2 |
|
|
|
if (sscanf(str, "bytes %" SCNuMAX "-%" SCNuMAX, &start, &end) != 2 |
|
|
|
|| start != *offset || start > end) |
|
|
|
/* A single range response is what we asked for, but not at that
|
|
|
|
* start offset. */ |
|
|
|
@ -140,7 +140,7 @@ static uintmax_t vlc_http_msg_get_file_size(const struct vlc_http_msg *resp) |
|
|
|
|
|
|
|
uintmax_t end, total; |
|
|
|
|
|
|
|
switch (sscanf(range, "bytes %*u-%ju/%ju", &end, &total)) |
|
|
|
switch (sscanf(range, "bytes %*u-%" SCNuMAX "/%" SCNuMAX, &end, &total)) |
|
|
|
{ |
|
|
|
case 1: |
|
|
|
if (unlikely(end == UINTMAX_MAX)) |
|
|
|
@ -159,7 +159,7 @@ static uintmax_t vlc_http_msg_get_file_size(const struct vlc_http_msg *resp) |
|
|
|
if (range == NULL) |
|
|
|
return -1; /* valid but helpless response */ |
|
|
|
|
|
|
|
if (sscanf(range, "bytes */%ju", &total) == 1) |
|
|
|
if (sscanf(range, "bytes */%" SCNuMAX, &total) == 1) |
|
|
|
return total; /* this occurs when seeking beyond EOF */ |
|
|
|
} |
|
|
|
|
|
|
|
|