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
This commit is contained in:
Vincent Penquerc'h 2016-04-15 12:54:32 +01:00
parent 62655029c8
commit d1ecd3cfa7

View file

@ -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;
}