From 1fae8de0d580e7987787c5d68415006479bdb5fa Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 27 Apr 2024 09:48:10 -0700 Subject: [PATCH] rid is always unsigned --- examples/postcard.modal | 2 -- src/modal.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/postcard.modal b/examples/postcard.modal index 478b784..ffa521d 100644 --- a/examples/postcard.modal +++ b/examples/postcard.modal @@ -1,4 +1,3 @@ - <> (what is ?x) (is ?x a (programming language)) <> (is ?x a ?y) (or, is ?x (a virtual machine)) <> (or, is ?x ?y) (?x is ?y <> ?y (a meta-language)) @@ -6,4 +5,3 @@ <> (?x is ?x) (?(?: ?:) ?x) what is modal - diff --git a/src/modal.c b/src/modal.c index c7bc1a4..1cb3d72 100644 --- a/src/modal.c +++ b/src/modal.c @@ -210,10 +210,10 @@ echo_rule(Rule *r, char *field) char c, *s = field; putc('(', stdout); while((c = *s++)) { - int rid; + unsigned int rid; putc(c, stdout); if(c == '?') - c = *s++, rid = c - '0', putc(rid < 8 ? r->reg[rid] : c, stdout); + c = *s++, rid = c - '0', putc(rid < 9 ? r->reg[rid] : c, stdout); } putc(')', stdout), putc(' ', stdout); }