mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 17:16:22 +00:00
Fixed cppcheck warnings
This commit is contained in:
@@ -830,62 +830,6 @@ stanza_contains_caps(xmpp_stanza_t * const stanza)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
stanza_is_version_request(xmpp_stanza_t * const stanza)
|
||||
{
|
||||
char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE);
|
||||
|
||||
if (g_strcmp0(type, STANZA_TYPE_GET) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
|
||||
|
||||
if (query == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
char *ns = xmpp_stanza_get_ns(query);
|
||||
|
||||
if (ns == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (strcmp(ns, STANZA_NS_VERSION) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
stanza_is_caps_request(xmpp_stanza_t * const stanza)
|
||||
{
|
||||
char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE);
|
||||
|
||||
if (g_strcmp0(type, STANZA_TYPE_GET) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
|
||||
|
||||
if (query == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
char *ns = xmpp_stanza_get_ns(query);
|
||||
|
||||
if (ns == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (strcmp(ns, XMPP_NS_DISCO_INFO) != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *
|
||||
stanza_caps_get_hash(xmpp_stanza_t * const stanza)
|
||||
{
|
||||
@@ -957,8 +901,6 @@ stanza_get_error_message(xmpp_stanza_t *stanza)
|
||||
|
||||
// otherwise check each defined-condition RFC-6120 8.3.3
|
||||
} else {
|
||||
xmpp_stanza_t *cond_stanza = NULL;
|
||||
|
||||
gchar *defined_conditions[] = {
|
||||
STANZA_NAME_BAD_REQUEST,
|
||||
STANZA_NAME_CONFLICT,
|
||||
@@ -985,7 +927,7 @@ stanza_get_error_message(xmpp_stanza_t *stanza)
|
||||
|
||||
int i;
|
||||
for (i = 0; i < ARRAY_SIZE(defined_conditions); i++) {
|
||||
cond_stanza = xmpp_stanza_get_child_by_name(error_stanza, defined_conditions[i]);
|
||||
xmpp_stanza_t *cond_stanza = xmpp_stanza_get_child_by_name(error_stanza, defined_conditions[i]);
|
||||
if (cond_stanza != NULL) {
|
||||
char *result = strdup(xmpp_stanza_get_name(cond_stanza));
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user