From 81d020bb74ad56a0d199657a0479e1712d2ab537 Mon Sep 17 00:00:00 2001 From: tema5002 Date: Thu, 2 Jul 2026 16:59:18 +0200 Subject: [PATCH] main.c: small tweak Reviewed-on: https://gitea.codersquack.nl/NeoFlock/noom/pulls/13 Co-authored-by: tema5002 Co-committed-by: tema5002 --- src/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index ddffcf5..aa4230d 100644 --- a/src/main.c +++ b/src/main.c @@ -43,11 +43,10 @@ void print_node(const noomP_Node* node, noom_uint_t depth) { void pretty(const char* code, noom_LuaVersion version, const noomP_Node* node, noom_uint_t indent) { for (noom_uint_t i = 0; i < indent; i++) putchar('\t'); const noom_uint_t len = noomL_tokenlen(code, node->source_offset, version); - char* fuckoff = code; - const char c = fuckoff[node->source_offset + len]; - fuckoff[node->source_offset + len] = '\0'; - printf("%*s%s %s", (int)len, code + node->source_offset, code[node->source_offset] != '\0' ? " -" : "", noomP_formatNodeType(node->type)); - fuckoff[node->source_offset + len] = c; + for (int i = 0; i < len; i++) { + putchar(*(code + node->source_offset + i)); + } + printf("%s %s", code[node->source_offset] != '\0' ? " -" : "", noomP_formatNodeType(node->type)); if (node->subnodec) { printf(" with %lld entr%s {\n", node->subnodec, node->subnodec == 1 ? "y" : "ies"); for (int i = 0; i < node->subnodec; i++) {