a4f04fe
From 2fc24847acc0e7d8718059f33b1d431d557050ef Mon Sep 17 00:00:00 2001
a4f04fe
From: Greg King <gregdk@users.sf.net>
a4f04fe
Date: Wed, 11 Mar 2020 17:28:42 -0400
a4f04fe
Subject: [PATCH 156/170] Fixed an error message printer.
a4f04fe
a4f04fe
The disassembler can be built and won't crash if it sees duplicate labels, and one of them is an unnamed label.
a4f04fe
---
a4f04fe
 src/da65/labels.c | 4 +++-
a4f04fe
 1 file changed, 3 insertions(+), 1 deletion(-)
a4f04fe
a4f04fe
diff --git a/src/da65/labels.c b/src/da65/labels.c
a4f04fe
index 97e195eb..542205c1 100644
a4f04fe
--- a/src/da65/labels.c
a4f04fe
+++ b/src/da65/labels.c
a4f04fe
@@ -97,7 +97,9 @@ static void AddLabel (unsigned Addr, attr_t Attr, const char* Name)
a4f04fe
              strcmp (SymTab[Addr], Name) == 0))) {
a4f04fe
             return;
a4f04fe
         }
a4f04fe
-        Error ("Duplicate label for address $%04X: %s/%s", Addr, SymTab[Addr], Name);
a4f04fe
+        Error ("Duplicate label for address $%04X (%s): '%s'", Addr,
a4f04fe
+               SymTab[Addr] == 0 ? "<unnamed label>" : SymTab[Addr],
a4f04fe
+               Name == 0 ? "<unnamed label>" : Name);
a4f04fe
     }
a4f04fe
 
a4f04fe
     /* Create a new label (xstrdup will return NULL if input NULL) */
a4f04fe
-- 
a4f04fe
2.26.0
a4f04fe