Open uncle-betty opened 3 years ago
FWIW, in case it's OK to have definitions without reference numbers, the following changes would fix the issue, I think:
~/chad/src$ git diff -w
diff --git a/src/chad.c b/src/chad.c
index 6224539..28e2a95 100644
--- a/src/chad.c
+++ b/src/chad.c
@@ -671,11 +671,12 @@ SV LogColor(uint32_t color, int ID, char* s) {
Log(itos(color, 16, 6, 1));
LogR(">");
}
- if (ID) {
+ char* refStr = ID ? ReferenceString(ID) : NULL;
+ if (refStr) {
LogR("<a href = \"");
LogR(foundWidName);
LogR(".html#");
- LogR(ReferenceString(ID));
+ LogR(refStr);
LogR("\" style=\"text-decoration: none; color: #");
Log(itos(color, 16, 6, 1));
LogR("\">");
I see the following crash on Ubuntu 18.04:
After looking around in the code a little, it appears that this issue is that
cowait
's definition lacks a reference number. Hence, ...SkipToEOL()
doesn't populate the.help
member ofcowait
'sKeyword
, which means that...ReferenceString()
inLogColor()
returnsNULL
forcowait
'sID
(258) whencowait
is used for the first time after its definition (byum*
), which means that...LogR()
is invoked withNULL
.I'm not sure what the correct fix would be. Should
cowait
have a reference number? Or should aKeyword
without a.help
text just be skipped byLogColor()
?