[vlc-commits] hls: Avoid using errno.

Hugo Beauzée-Luyssen git at videolan.org
Fri Mar 9 16:37:41 CET 2012


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Mar  9 16:34:59 2012 +0100| [7eb141b4800273870a95210a98c6464416a3b041] | committer: Hugo Beauzée-Luyssen

hls: Avoid using errno.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7eb141b4800273870a95210a98c6464416a3b041
---

 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;



More information about the vlc-commits mailing list