]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwelf_elf_e_machine_string: Clear errno before calling strtol
authorAndreas Schwab <schwab@suse.de>
Thu, 14 Nov 2019 13:54:58 +0000 (14:54 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 14 Nov 2019 22:18:34 +0000 (23:18 +0100)
Avoid spurious failure if errno is modified by any other library call in
the test.

Signed-off-by: Andreas Schwab <schwab@suse.de>
tests/ChangeLog
tests/dwelf_elf_e_machine_string.c

index 97b8dedb03f5fae8614bc51cbacbbe233a8cabe3..5b8a62246f675e24e6ce1b2b01443528fa33fc3b 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-14  Andreas Schwab  <schwab@suse.de>
+
+       * dwelf_elf_e_machine_string.c (main): Clear errno before calling
+       strtol.
+
 2019-09-02  Mark Wielaard  <mark@klomp.org>
 
        * run-readelf-s.sh: Add --dyn-syms case.
index 1df2b23388eae565bebf453301a5f52f3883dcf9..afad1058eb4071f32d55ff68984f60ebcb5833be 100644 (file)
@@ -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