From 643c39a2d5c6979f40ab336b9107ff45f220d049 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 3 Sep 2019 14:02:27 -0400 Subject: [PATCH] Corrected error where modification to allow use of brackets inside a cell instance name not related to an array moved a variable that was used later in the routine to the inside of an if block, effectively making that variable undefined in most cases. --- database/DBlabel2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/DBlabel2.c b/database/DBlabel2.c index c060ac14..9ddba125 100644 --- a/database/DBlabel2.c +++ b/database/DBlabel2.c @@ -296,6 +296,7 @@ DBTreeFindUse(name, use, scx) if ((def->cd_flags & CDAVAILABLE) == 0) (void) DBCellRead(def, (char *) NULL, TRUE, NULL); + cp = name; he = HashLookOnly(&def->cd_idHash, name); if (he == NULL || HashGetValue(he) == NULL) { @@ -306,7 +307,7 @@ DBTreeFindUse(name, use, scx) * array components that are expected, not array components * embedded in the name. */ - for (cp = name; *cp && *cp != '[' && *cp != '/'; cp++) + for (; *cp && *cp != '[' && *cp != '/'; cp++) /* Nothing */; csave = *cp; *cp = '\0';