summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwarf-extract-struct.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dwarf-extract-struct.c b/dwarf-extract-struct.c
index 1007a5c..6f026dc 100644
--- a/dwarf-extract-struct.c
+++ b/dwarf-extract-struct.c
@@ -436,12 +436,12 @@ static void print_field(Dwarf_Debug dbg, Dwarf_Die die, const char *field_name,
}
if (type_tag == DW_TAG_structure_type) {
- snprintf(type_buf, 1024, "struct %s%s",
- pointer ? "*" : "", type_name);
+ snprintf(type_buf, 1024, "struct %s %s",
+ type_name, pointer ? "*" : "");
} else if (type_tag == DW_TAG_base_type
|| type_tag == DW_TAG_typedef) {
- snprintf(type_buf, 1024, "%s%s", pointer ? "*" : "",
- type_name);
+ snprintf(type_buf, 1024, "%s %s", type_name,
+ pointer ? "*" : "");
} else {
const char *tag_name;
@@ -462,7 +462,7 @@ static void print_field(Dwarf_Debug dbg, Dwarf_Die die, const char *field_name,
dwarf_dealloc(dbg, type_die, DW_DLA_DIE);
}
- printf("\t\tstruct {\n\t\t\tchar padding%i[%u]\n\t\t\t%s %s\n\t\t};\n",
+ printf("\t\tstruct {\n\t\t\tchar padding%i[%u];\n\t\t\t%s%s;\n\t\t};\n",
padnum,
(unsigned int) offset,
type_buf, field_name);