vlc/vlc-2.0 | branch: master | Hugo Beauzée-Luyssen <[email protected]> | Fri Mar 9 16:34:59 2012 +0100| [de31065a9f80304856e550b1ac5fbf92ec7fc730] | committer: Jean-Baptiste Kempf
hls: Avoid using errno. (cherry picked from commit 7eb141b4800273870a95210a98c6464416a3b041) Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=de31065a9f80304856e550b1ac5fbf92ec7fc730 --- modules/stream_filter/httplive.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c index f13c568..f9eba12 100644 --- a/modules/stream_filter/httplive.c +++ b/modules/stream_filter/httplive.c @@ -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; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
