From cd0dccd01e16fa404e03974d30ded3aebdb1c4bc Mon Sep 17 00:00:00 2001 From: Adrian Negreanu Date: Tue, 17 Dec 2013 13:48:54 +0200 Subject: scanner: set errno=0 before strtol POSIX says to set errno=0 before calling strtol since the return value alne cannot tell a failure. on ubuntu armel I get: ../src/wayland-scanner client-header < ../../protocol/wayland.xml > wayland-client-protocol.h :1188: error: invalid integer (2) Signed-off-by: Adrian Negreanu --- src/scanner.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scanner.c b/src/scanner.c index a030181..243ddfd 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -399,6 +399,7 @@ start_element(void *data, const char *element_name, const char **atts) message->destructor = 0; if (since != NULL) { + errno = 0; version = strtol(since, &end, 0); if (errno == EINVAL || end == since || *end != '\0') fail(&ctx->loc, -- cgit v1.2.3