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:
@@ -4633,7 +4633,7 @@ cmd_bookmark(ProfWin* window, const char* const command, gchar** args)
|
||||
// default to current nickname, password, and autojoin "on"
|
||||
ProfMucWin* mucwin = (ProfMucWin*)window;
|
||||
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
||||
char* nick = muc_nick(mucwin->roomjid);
|
||||
const char* const nick = muc_nick(mucwin->roomjid);
|
||||
char* password = muc_password(mucwin->roomjid);
|
||||
gboolean added = bookmark_add(mucwin->roomjid, nick, password, "on", NULL);
|
||||
if (added) {
|
||||
|
||||
Reference in New Issue
Block a user