From efbf233c8591c9310e326603b1c16368afd64564 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Wed, 27 Apr 2016 10:31:28 +0000 Subject: Define stanza's attributes as const char* In most get-like funcitons libstrophe returns pointer to a string that resides in an internal structure (e.g. xmpp_stanza_t). Hence, Profanity must not change such strings. Define respective variables as 'const char*' to reduce a chance of error and conform future libstrophe's interface. This patch mostly replaces 'char *' with 'const char*', but also fixes two memory leaks after stanza_get_reason(). Add comment within stanza_get_reason() to fix conflict with different allocator types. --- src/muc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/muc.c') diff --git a/src/muc.c b/src/muc.c index 176e943d..7ebbbb0c 100644 --- a/src/muc.c +++ b/src/muc.c @@ -723,7 +723,7 @@ muc_jid_autocomplete_add_all(const char *const room, GSList *jids) if (chat_room->jid_ac) { GSList *curr_jid = jids; while (curr_jid) { - char *jid = curr_jid->data; + const char *jid = curr_jid->data; Jid *jidp = jid_create(jid); if (jidp) { if (jidp->barejid) { -- cgit 1.4.1-2-gfad0