summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2007-08-04 17:06:14 +0000
committerUlrich Drepper <[email protected]>2007-08-04 17:06:14 +0000
commitc98bcc796529b7ec56f369c743748d9ff32abf61 (patch)
tree2e2acec0599220195eaa4186d76a67b69c5a6292 /src
parent60fc84c4288cd6edda3a78dff95e52b5858bacb2 (diff)
Minimal cleanups of large merge.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/readelf.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d94dcfe1..505abb42 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-04 Ulrich Drepper <[email protected]>
+
+ * 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 <[email protected]>
* readelf.c (print_string_sections): New variable.
diff --git a/src/readelf.c b/src/readelf.c
index 153176c2..e8b0bb4a 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -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)