mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-10 05:34:16 -04:00
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 <stdin>:1188: error: invalid integer (2) Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
This commit is contained in:
parent
01bde6319f
commit
cd0dccd01e
1 changed files with 1 additions and 0 deletions
|
|
@ -399,6 +399,7 @@ start_element(void *data, const char *element_name, const char **atts)
|
||||||
message->destructor = 0;
|
message->destructor = 0;
|
||||||
|
|
||||||
if (since != NULL) {
|
if (since != NULL) {
|
||||||
|
errno = 0;
|
||||||
version = strtol(since, &end, 0);
|
version = strtol(since, &end, 0);
|
||||||
if (errno == EINVAL || end == since || *end != '\0')
|
if (errno == EINVAL || end == since || *end != '\0')
|
||||||
fail(&ctx->loc,
|
fail(&ctx->loc,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue