diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-26 13:55:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-26 13:55:31 +0300 |
commit | 59f72fa52bd560003af3c4635f92a885d1c07dbc (patch) | |
tree | a574aa7c8115bda94252bbd0587cf1158b49e1b3 /protocols/JabberG/src/jabber_util.cpp | |
parent | 1bf0fece31876c453bea93479e6d0d40bd8a564d (diff) |
XmlFirstChild / XmlGetAttr - safe wrappers for tinyxml2
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_util.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 7ae125f069..30f4137d68 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -254,7 +254,7 @@ CMStringW JabberErrorMsg(const TiXmlElement *errorNode, int *pErrorCode) return ret;
}
- if (auto *pChild = errorNode->FirstChildElement("error"))
+ if (auto *pChild = XmlFirstChild(errorNode, "error"))
errorNode = pChild;
int errorCode = errorNode->IntAttribute("code");
@@ -265,7 +265,7 @@ CMStringW JabberErrorMsg(const TiXmlElement *errorNode, int *pErrorCode) if (str == nullptr) {
for (auto *c : TiXmlEnum(errorNode)) {
- const char *attr = c->Attribute("xmlns");
+ const char *attr = XmlGetAttr(c, "xmlns");
if (attr && !mir_strcmp(attr, "urn:ietf:params:xml:ns:xmpp-stanzas")) {
str = c->Name();
break;
@@ -508,7 +508,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll) int JabberGetPacketID(const TiXmlElement *n)
{
- const char *str = n->Attribute("id");
+ const char *str = XmlGetAttr(n, "id");
if (str)
if (!strncmp(str, JABBER_IQID, _countof(JABBER_IQID) - 1))
return atoi(str + _countof(JABBER_IQID) - 1);
@@ -833,7 +833,7 @@ bool JabberReadXep203delay(const TiXmlElement *node, time_t &msgTime) if (n == nullptr)
return false;
- const char *ptszTimeStamp = n->Attribute("stamp");
+ const char *ptszTimeStamp = XmlGetAttr(n, "stamp");
if (ptszTimeStamp == nullptr)
return false;
|