summaryrefslogtreecommitdiff
path: root/lib9p/core_gen/c_format.py
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-14 07:12:19 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-14 11:59:02 -0600
commitfe04e65988a27164909fd9b1edc7f44026984345 (patch)
tree23d384a1d8256f929e2083441c1229a6d591853c /lib9p/core_gen/c_format.py
parentd67fd84e5f5aa34d5ddad40355e05446bca00a37 (diff)
lib9p_core: Fix a whitespace bug when formatting arrays
Diffstat (limited to 'lib9p/core_gen/c_format.py')
-rw-r--r--lib9p/core_gen/c_format.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib9p/core_gen/c_format.py b/lib9p/core_gen/c_format.py
index 8c0cded..f9eee90 100644
--- a/lib9p/core_gen/c_format.py
+++ b/lib9p/core_gen/c_format.py
@@ -140,7 +140,8 @@ def gen_c_format(versions: set[str], typs: list[idl.UserType]) -> str:
ret += f'\tfmt_state_puts(state, " {member.membname}=[");\n'
ret += f"\tfor ({cnt_typ} i = 0; i < {cnt_str}; i++) {{\n"
ret += "\t\tif (i)\n"
- ret += '\t\t\tfmt_state_puts(state, ", ");\n'
+ ret += "\t\t\tfmt_state_putchar(state, ',');\n"
+ ret += "\t\tfmt_state_putchar(state, ' ');\n"
if isinstance(member.typ, idl.Primitive):
ret += f'\t\tfmt_state_printf(state, "%"PRIu{member.typ.static_size*8}, self->{member.membname}[i]);\n'
else: