]> sbz's 6dev Repos - ctfdump/.git/commitdiff
Use ctf_off2name() when dumping the string table
authorMartin Pieuchot <mpi@openbsd.org>
Sun, 27 Mar 2016 15:34:06 +0000 (17:34 +0200)
committerMartin Pieuchot <mpi@openbsd.org>
Sun, 27 Mar 2016 15:34:06 +0000 (17:34 +0200)
ctfdump.c

index 5e287c8059d80892ccb462e9795b2f2f11ddfd99..1cdb3a19a4bdb88374e24dafc42af106bdc1b1c0 100644 (file)
--- a/ctfdump.c
+++ b/ctfdump.c
@@ -363,10 +363,10 @@ ctf_dump(const char *p, size_t size, uint8_t flags)
                const char              *str;
 
                while (offset < cth->cth_strlen) {
-                       str = data + cth->cth_stroff + offset;
+                       str = ctf_off2name(cth, data, dlen, offset);
 
                        printf("  [%u] ", offset);
-                       if (*str != '\0')
+                       if (strcmp(str, "(anon)"))
                                offset += printf("%s\n", str);
                        else {
                                printf("\\0\n");