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.
This commit is contained in:
@@ -148,7 +148,7 @@ GSList* presence_get_subscription_requests(void);
|
||||
gint presence_sub_request_count(void);
|
||||
void presence_reset_sub_request_search(void);
|
||||
char* presence_sub_request_find(const char *const search_str);
|
||||
void presence_join_room(char *room, char *nick, char * passwd);
|
||||
void presence_join_room(const char *const room, const char *const nick, const char *const passwd);
|
||||
void presence_change_room_nick(const char *const room, const char *const nick);
|
||||
void presence_leave_chat_room(const char *const room_jid);
|
||||
void presence_send(resource_presence_t status, const char *const msg, int idle, char *signed_status);
|
||||
|
||||
Reference in New Issue
Block a user