From b0663fc2360d37075c3bbd72d88f53292004fe84 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 8 Apr 2024 11:24:56 -0700 Subject: [PATCH] Move rules pointer on add_rule --- src/modal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modal.c b/src/modal.c index ee1e872..688020c 100644 --- a/src/modal.c +++ b/src/modal.c @@ -5,7 +5,7 @@ typedef struct { } Rule; static int rules_len, direction; -static Rule rules[0x100], *rules_; +static Rule rules[0x1000], *rules_ = rules; static char dict[0x8000], *dict_ = dict; static char bank_a[0x4000], *prog_ = bank_a; static char bank_b[0x4000], *outp_ = bank_b; @@ -137,8 +137,8 @@ static int add_rule(char *p) { char c; - Rule *r = &rules[rules_len++]; - rules_++; + Rule *r = rules_++; + rules_len++; p += 2; while((c = *p) && c <= ' ') p++; r->a = parse_rule(p), p = walk(p);