Commit 7eb141b4 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

hls: Avoid using errno.

parent 8a570321
...@@ -574,10 +574,11 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati ...@@ -574,10 +574,11 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
return VLC_EGENERIC; return VLC_EGENERIC;
int value; int value;
char *endptr;
if (hls->version < 3) if (hls->version < 3)
{ {
value = strtol(token, NULL, 10); value = strtol(token, &endptr, 10);
if (errno == ERANGE) if (token == endptr)
{ {
*duration = -1; *duration = -1;
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -586,8 +587,8 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati ...@@ -586,8 +587,8 @@ static int parse_SegmentInformation(hls_stream_t *hls, char *p_read, int *durati
} }
else else
{ {
double d = strtod(token, (char **) NULL); double d = strtof(token, &endptr);
if (errno == ERANGE) if (token == endptr)
{ {
*duration = -1; *duration = -1;
return VLC_EGENERIC; 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