From: Andreas Schwab Date: Thu, 14 Nov 2019 13:54:58 +0000 (+0100) Subject: dwelf_elf_e_machine_string: Clear errno before calling strtol X-Git-Tag: elfutils-0.178~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be1ed9f108d2001e84437b4162d889bff955be8f;p=thirdparty%2Felfutils.git dwelf_elf_e_machine_string: Clear errno before calling strtol Avoid spurious failure if errno is modified by any other library call in the test. Signed-off-by: Andreas Schwab --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 97b8dedb0..5b8a62246 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2019-11-14 Andreas Schwab + + * dwelf_elf_e_machine_string.c (main): Clear errno before calling + strtol. + 2019-09-02 Mark Wielaard * run-readelf-s.sh: Add --dyn-syms case. diff --git a/tests/dwelf_elf_e_machine_string.c b/tests/dwelf_elf_e_machine_string.c index 1df2b2338..afad1058e 100644 --- a/tests/dwelf_elf_e_machine_string.c +++ b/tests/dwelf_elf_e_machine_string.c @@ -40,6 +40,7 @@ main (int argc, char **argv) int em; const char *machine; + errno = 0; if (strncmp ("0x", argv[i], 2) == 0) val = strtol (&argv[i][2], NULL, 16); else