mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-08-01 04:46:21 +00:00
Make muc_nick return a const char* const
In the documentation of the `muc_nick` function we can read: > The nickname is owned by the chat room and should not be modified or freed We should reflect that in the return type and `strdup` the value for the plugin API. Fixes: https://github.com/profanity-im/profanity/issues/2013
This commit is contained in:
@@ -259,7 +259,7 @@ _send_room_presence(xmpp_stanza_t* presence)
|
||||
GList* curr = rooms;
|
||||
while (curr) {
|
||||
const char* room = curr->data;
|
||||
const char* nick = muc_nick(room);
|
||||
const char* const nick = muc_nick(room);
|
||||
|
||||
if (nick) {
|
||||
auto_char char* full_room_jid = create_fulljid(room, nick);
|
||||
@@ -327,7 +327,7 @@ presence_leave_chat_room(const char* const room_jid)
|
||||
{
|
||||
assert(room_jid != NULL);
|
||||
|
||||
char* nick = muc_nick(room_jid);
|
||||
const char* const nick = muc_nick(room_jid);
|
||||
if (!nick) {
|
||||
log_error("Could not get nickname for room: %s", room_jid);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user