From d1ecd3cfa732fe9aeeb55850d9fe8bc4801c8099 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 15 Apr 2016 12:54:32 +0100 Subject: [PATCH] subparse: fix build with GCC 4.6.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gstsubparse.c: In function ‘parse_subrip’: gstsubparse.c:988:7: error: ignoring return value of ‘strtol’, declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors https://bugzilla.gnome.org/show_bug.cgi?id=765042 --- gst/subparse/gstsubparse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index fd14733459..c8acc0650e 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -982,11 +982,17 @@ parse_subrip (ParserState * state, const gchar * line) switch (state->state) { case 0:{ char *endptr; + guint64 id; /* looking for a single integer as a Cue ID, but we * don't actually use it */ - (void) strtol (line, &endptr, 10); - if (endptr != line && *endptr == '\0') + errno = 0; + id = g_ascii_strtoull (line, &endptr, 10); + if (id == G_MAXUINT64 && errno == ERANGE) + state->state = 1; + else if (id == 0 && errno == EINVAL) + state->state = 1; + else if (endptr != line && *endptr == '\0') state->state = 1; return NULL; }