summaryrefslogtreecommitdiffstats
path: root/ucs2-interface
diff options
context:
space:
mode:
authorThorsten Kummermehr <thorsten.kummermehr@k2l.de>2017-11-07 16:14:34 +0100
committerThorsten Kummermehr <thorsten.kummermehr@k2l.de>2017-11-07 16:14:34 +0100
commit5a43116f6ec3e84fbdbfa81d6713170b889a8e99 (patch)
treede526ac39d8be6b3a5146d5b8918beeae0be8f3d /ucs2-interface
parent297bad20e3385ecf4d9755370f76463c5072d0dd (diff)
Correct handling of empty nodes
Diffstat (limited to 'ucs2-interface')
-rw-r--r--ucs2-interface/ucs-xml/UcsXml.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/ucs2-interface/ucs-xml/UcsXml.c b/ucs2-interface/ucs-xml/UcsXml.c
index 3078749..4c392cd 100644
--- a/ucs2-interface/ucs-xml/UcsXml.c
+++ b/ucs2-interface/ucs-xml/UcsXml.c
@@ -710,29 +710,30 @@ static ParseResult_t ParseAll(mxml_node_t *tree, UcsXmlVal_t *ucs, PrivateData_t
if (Parse_Success != (result = ParseNode(sub, priv)))
return result;
/*/Iterate all connections. Node without any connection is also valid.*/
- if (!GetElementArray(sub->child, ALL_CONNECTIONS, &conType, &con))
- continue;
- while(con)
+ if (GetElementArray(sub->child, ALL_CONNECTIONS, &conType, &con))
{
- const char *socTypeStr;
- MSocketType_t socType;
- mxml_node_t *soc;
- memset(&priv->conData, 0, sizeof(ConnectionData_t));
- if (Parse_Success != (result = ParseConnection(con, conType, priv)))
- return result;
- /*Iterate all sockets*/
- if(!GetElementArray(con->child, ALL_SOCKETS, &socTypeStr, &soc)) RETURN_ASSERT(Parse_XmlError);
- while(soc)
+ while(con)
{
- if (!GetSocketType(socTypeStr, &socType)) RETURN_ASSERT(Parse_XmlError);
- if (Parse_Success != (result = ParseSocket(soc, (0 == priv->conData.sockCnt), socType, &priv->conData.jobList, priv)))
+ const char *socTypeStr;
+ MSocketType_t socType;
+ mxml_node_t *soc;
+ memset(&priv->conData, 0, sizeof(ConnectionData_t));
+ if (Parse_Success != (result = ParseConnection(con, conType, priv)))
return result;
- ++priv->conData.sockCnt;
- if(!GetElementArray(soc, ALL_SOCKETS, &socTypeStr, &soc))
+ /*Iterate all sockets*/
+ if(!GetElementArray(con->child, ALL_SOCKETS, &socTypeStr, &soc)) RETURN_ASSERT(Parse_XmlError);
+ while(soc)
+ {
+ if (!GetSocketType(socTypeStr, &socType)) RETURN_ASSERT(Parse_XmlError);
+ if (Parse_Success != (result = ParseSocket(soc, (0 == priv->conData.sockCnt), socType, &priv->conData.jobList, priv)))
+ return result;
+ ++priv->conData.sockCnt;
+ if(!GetElementArray(soc, ALL_SOCKETS, &socTypeStr, &soc))
+ break;
+ }
+ if(!GetElementArray(con, ALL_CONNECTIONS, &conType, &con))
break;
}
- if(!GetElementArray(con, ALL_CONNECTIONS, &conType, &con))
- break;
}
++ucs->nodSize;
if (!GetElement(sub, NODE, false, &sub, false))