diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2016-04-15 12:54:32 +0100 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2016-04-15 13:33:41 +0100 |
commit | d1ecd3cfa732fe9aeeb55850d9fe8bc4801c8099 (patch) | |
tree | 0c71c3ce55874d43711b75d3d17c7dbc1373b901 /gst | |
parent | 62655029c8ec76e563b88c30869801f077540102 (diff) |
subparse: fix build with GCC 4.6.3
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/subparse/gstsubparse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index fd1473345..c8acc0650 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; } |