Commit de31065a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

hls: Avoid using errno.

(cherry picked from commit 7eb141b4800273870a95210a98c6464416a3b041)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f3e2738e
......@@ -574,10 +574,11 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
return VLC_EGENERIC;
int value;
char *endptr;
if (hls->version < 3)
{
value = strtol(token, NULL, 10);
if (errno == ERANGE)
value = strtol(token, &endptr, 10);
if (token == endptr)
{
*duration = -1;
return VLC_EGENERIC;
......@@ -586,8 +587,8 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
}
else
{
double d = strtod(token, (char **) NULL);
if (errno == ERANGE)
double d = strtof(token, &endptr);
if (token == endptr)
{
*duration = -1;
return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment