From ee1ffd4468dcba8efad8f0cdc11e945ee3a4219b Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Tue, 17 Jun 2008 12:27:29 +1000 Subject: [PATCH] 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 --- site_ansto/lssmonitor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site_ansto/lssmonitor.c b/site_ansto/lssmonitor.c index 8a67685c..af2f092d 100644 --- a/site_ansto/lssmonitor.c +++ b/site_ansto/lssmonitor.c @@ -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,9 +431,11 @@ 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); + } } }