stanza: return const char* for non allocated strings

If interface function returns char* the result must be freed with
xmpp_free().

In case of const char* the result must not be changed by user. Also, the
result is valid only during stanza lifetime.
This commit is contained in:
Dmitry Podgorny
2016-04-27 11:56:50 +00:00
parent c0aad0bf00
commit a3da77b8f6
7 changed files with 45 additions and 50 deletions

View File

@@ -35,7 +35,7 @@ void handler_fire_stanza(xmpp_conn_t * const conn,
xmpp_stanza_t * const stanza)
{
xmpp_handlist_t *item, *prev;
char *id, *ns, *name, *type;
const char *id, *ns, *name, *type;
/* call id handlers */
id = xmpp_stanza_get_id(stanza);