diff options
author | Thorsten Kummermehr <thorsten.kummermehr@k2l.de> | 2017-11-07 16:14:34 +0100 |
---|---|---|
committer | Thorsten Kummermehr <thorsten.kummermehr@k2l.de> | 2017-11-07 16:14:34 +0100 |
commit | 5a43116f6ec3e84fbdbfa81d6713170b889a8e99 (patch) | |
tree | de526ac39d8be6b3a5146d5b8918beeae0be8f3d /ucs2-interface/ucs-xml/UcsXml.c | |
parent | 297bad20e3385ecf4d9755370f76463c5072d0dd (diff) |
Correct handling of empty nodes
Diffstat (limited to 'ucs2-interface/ucs-xml/UcsXml.c')
-rw-r--r-- | ucs2-interface/ucs-xml/UcsXml.c | 37 |
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))
|