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/event/server_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/event/server_events.h') diff --git a/src/event/server_events.h b/src/event/server_events.h index b16eddbc..7dc0107f 100644 --- a/src/event/server_events.h +++ b/src/event/server_events.h @@ -58,7 +58,7 @@ void sv_ev_inactive(char *barejid, char *resource); void sv_ev_activity(char *barejid, char *resource, gboolean send_states); void sv_ev_gone(const char *const barejid, const char *const resource); void sv_ev_subscription(const char *from, jabber_subscr_t type); -void sv_ev_message_receipt(char *barejid, char *id); +void sv_ev_message_receipt(const char *const barejid, const char *const id); void sv_ev_contact_offline(char *contact, char *resource, char *status); void sv_ev_contact_online(char *contact, Resource *resource, GDateTime *last_activity, char *pgpkey); void sv_ev_leave_room(const char *const room); -- cgit 1.4.1-2-gfad0