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;