+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.
#include <argp.h>
#include <assert.h>
+#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
#include <error.h>
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');
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)