diff options
Diffstat (limited to 'src/stdlib/structs.c')
| -rw-r--r-- | src/stdlib/structs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/stdlib/structs.c b/src/stdlib/structs.c index 9a14779e..d4a22d93 100644 --- a/src/stdlib/structs.c +++ b/src/stdlib/structs.c @@ -143,10 +143,12 @@ PUREFUNC public Text_t Struct$as_text(const void *obj, bool colorize, const Type { if (!obj) return Text$from_str(type->StructInfo.name); - if (type->StructInfo.is_secret || type->StructInfo.is_opaque) - return Text$format(colorize ? "\x1b[0;1m%s\x1b[m(...)" : "%s(...)", type->StructInfo.name); + Text_t name = Text$from_str(type->StructInfo.name); + if (type->StructInfo.is_secret || type->StructInfo.is_opaque) { + return colorize ? Texts(Text("\x1b[0;1m"), name, Text("\x1b[m(...)")) : Texts(name, Text("(...)")); + } - Text_t text = Text$format(colorize ? "\x1b[0;1m%s\x1b[m(" : "%s(", type->StructInfo.name); + Text_t text = colorize ? Texts(Text("\x1b[0;1m"), name, Text("\x1b[m(")) : Texts(name, Text("(")); ptrdiff_t byte_offset = 0; ptrdiff_t bit_offset = 0; for (int i = 0; i < type->StructInfo.num_fields; i++) { |
