From 04e4edf05f0a915e40cdf4a9f76b0a57041ee7e3 Mon Sep 17 00:00:00 2001 From: neauoire Date: Sun, 17 Oct 2021 19:10:29 -0700 Subject: [PATCH] Fixed an issue with the ref counter in uxnasm --- src/uxnasm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uxnasm.c b/src/uxnasm.c index 5959129..19729f1 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -191,9 +191,10 @@ addref(Label *l, Uint8 rel) if(rel) { int pos = cpos(l->name, '/'); if(pos != -1) { - char root[64]; - Label *rl = findlabel(scpy(l->name, root, pos)); - ++rl->refs; + char parent[64]; + Label *rl = findlabel(scpy(l->name, parent, pos)); + if(rl) + ++rl->refs; } } return ++l->refs;