Fix segfault triggered by addition of version info to low side server document element

r2631 | ffr | 2008-06-17 12:27:29 +1000 (Tue, 17 Jun 2008) | 2 lines
This commit is contained in:
Ferdi Franceschini
2008-06-17 12:27:29 +10:00
committed by Douglas Clowes
parent e59b073066
commit ee1ffd4468

View File

@@ -389,6 +389,7 @@ static int findElement(SConnection *pCon, const char *string) {
for(n = mxmlWalkNext(tree, tree, MXML_DESCEND); n != NULL; n = mxmlWalkNext(n, tree, MXML_DESCEND)) {
if (n->value.element.attrs) {
if (mxmlElementGetAttr(n, "version") == NULL) {
if (strcasestr(mxmlElementGetAttr(n, "description"), string) != NULL) {
snprintf(line, 132, "%s.%s %s = %s (%s)", string, mxmlElementGetAttr(n, "description"), mxmlElementGetAttr(n, "tag"), n->child->value.text.string, mxmlElementGetAttr(n, "time"));
SCWrite(pCon, line, eStatus);
@@ -400,7 +401,9 @@ static int findElement(SConnection *pCon, const char *string) {
SCWrite(pCon, line, eStatus);
found = 1;
}
} else {
// check version number here
}
}
}
@@ -428,11 +431,13 @@ static int LSS_Action(SConnection *pCon, SicsInterp *pSics,
for (node = mxmlWalkNext(current, tree, MXML_DESCEND); node != NULL; node = mxmlWalkNext(node, tree, MXML_DESCEND)) {
if (node->value.element.attrs) {
if (mxmlElementGetAttr(node, "version") == NULL) {
snprintf(line, 132, "%s.%s %s = %s (%s)", argv[0], mxmlElementGetAttr(node, "description"), mxmlElementGetAttr(node, "tag"), node->child->value.text.string, mxmlElementGetAttr(node, "time"));
SCWrite(pCon, line, eStatus);
}
}
}
return OKOK;
}