diff --git a/connection.cpp b/connection.cpp index 5118fd8..82651f2 100644 --- a/connection.cpp +++ b/connection.cpp @@ -562,7 +562,7 @@ int connection__message_handler(xmpp_conn_t *conn, xmpp_stanza_t *stanza, void * { int tags_count = weechat_hdata_integer(weechat_hdata_get("line_data"), line_data, "tags_count"); - char str_tag[20] = {0}; + char str_tag[24] = {0}; for (int n_tag = 0; n_tag < tags_count; n_tag++) { snprintf(str_tag, sizeof(str_tag), "%d|tags_array", n_tag); diff --git a/xmpp/xep-0045.inl b/xmpp/xep-0045.inl index 06b3ccc..2aa2da1 100644 --- a/xmpp/xep-0045.inl +++ b/xmpp/xep-0045.inl @@ -279,21 +279,21 @@ namespace xml { using xmpp_stanzas = urn::ietf::params::xml::ns::xmpp_stanzas; - for (auto& child : node.get_children("not-authorized")) + if (node.get_children("not-authorized").size() > 0) condition = not_authorized; - for (auto& child : node.get_children("forbidden")) + if (node.get_children("forbidden").size() > 0) condition = forbidden; - for (auto& child : node.get_children("item-not-found")) + if (node.get_children("item-not-found").size() > 0) condition = item_not_found; - for (auto& child : node.get_children("not-allowed")) + if (node.get_children("not-allowed").size() > 0) condition = not_allowed; - for (auto& child : node.get_children("not-acceptable")) + if (node.get_children("not-acceptable").size() > 0) condition = not_acceptable; - for (auto& child : node.get_children("registration-required")) + if (node.get_children("registration-required").size() > 0) condition = registration_required; - for (auto& child : node.get_children("conflict")) + if (node.get_children("conflict").size() > 0) condition = conflict; - for (auto& child : node.get_children("service-unavailable")) + if (node.get_children("service-unavailable").size() > 0) condition = service_unavailable; for (auto& child : node.get_children("text"))