]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Minimal cleanups of large merge.
authorUlrich Drepper <drepper@redhat.com>
Sat, 4 Aug 2007 17:06:14 +0000 (17:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 4 Aug 2007 17:06:14 +0000 (17:06 +0000)
src/ChangeLog
src/readelf.c

index d94dcfe1cbf69104cf1cb6bcf7ceff14f6382989..505abb429248ef0eab9544ce29109f1d61553e96 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-04  Ulrich Drepper  <drepper@redhat.com>
+
+       * readelf.c (hex_dump): Use isprint to determine whether to print
+       character itself or full stop character.
+       (dump_data): No need to check endp for NULL after strtol call.
+
 2007-08-03  Roland McGrath  <roland@redhat.com>
 
        * readelf.c (print_string_sections): New variable.
index 153176c2ab5fb9655c326c08edb96652606967f6..e8b0bb4a7f9464dec529d283e10f25a685d84fb7 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <argp.h>
 #include <assert.h>
+#include <ctype.h>
 #include <dwarf.h>
 #include <errno.h>
 #include <error.h>
@@ -5071,7 +5072,7 @@ hex_dump (const uint8_t *data, size_t len)
       for (size_t i = 0; i < chunk; ++i)
        {
          unsigned char b = data[pos + i];
-         printf ("%c", b > ' ' && b < 0x7f ? b : '.');
+         printf ("%c", isprint (b) ? b : '.');
        }
 
       putchar ('\n');
@@ -5096,7 +5097,7 @@ dump_data (Ebl *ebl)
 
       char *endp = NULL;
       unsigned long int shndx = strtoul (a->arg, &endp, 0);
-      if (endp != NULL && endp != a->arg && *endp == '\0')
+      if (endp != a->arg && *endp == '\0')
        {
          scn = elf_getscn (ebl->elf, shndx);
          if (scn == NULL)