From: Greg King Date: Fri, 4 Jan 2019 07:29:17 +0000 (-0500) Subject: Fixed a duplicate-label test. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd6e167982615cdf6cc529c8b15d4b84c0058fa3;p=cc65 Fixed a duplicate-label test. Don't call strcmp() if either argument is NULL. --- diff --git a/src/da65/labels.c b/src/da65/labels.c index 6aa7f38cf..97e195ebf 100644 --- a/src/da65/labels.c +++ b/src/da65/labels.c @@ -92,7 +92,9 @@ static void AddLabel (unsigned Addr, attr_t Attr, const char* Name) ** have a name (you guessed that, didn't you?). */ if (ExistingAttr == Attr && - ((Name == 0 && SymTab[Addr] == 0) || strcmp (SymTab[Addr], Name) == 0)) { + ((Name == 0 && SymTab[Addr] == 0) || + (Name != 0 && SymTab[Addr] != 0 && + strcmp (SymTab[Addr], Name) == 0))) { return; } Error ("Duplicate label for address $%04X: %s/%s", Addr, SymTab[Addr], Name);