1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Adapt to new g_string_free() usage

Somehow this must have been overlooked when doing
e59c401c84.
This commit is contained in:
Michael Vetter 2023-03-23 10:23:51 +01:00
parent 12b997c5f3
commit ac440e72d7
2 changed files with 4 additions and 13 deletions

View File

@ -514,10 +514,7 @@ chatwin_get_string(ProfChatWin* chatwin)
g_string_append_printf(res, ", %d unread", chatwin->unread);
}
char* resstr = res->str;
g_string_free(res, FALSE);
return resstr;
return g_string_free(res, FALSE);
}
void

View File

@ -943,17 +943,11 @@ mucwin_get_string(ProfMucWin* mucwin)
{
assert(mucwin != NULL);
GString* res = g_string_new("Room ");
g_string_append(res, mucwin->roomjid);
if (mucwin->unread > 0) {
g_string_append_printf(res, ", %d unread", mucwin->unread);
return g_strdup_printf("Room %s, %d unread", mucwin->roomjid, mucwin->unread);
} else {
return g_strdup_printf("Room %s", mucwin->roomjid);
}
char* resstr = res->str;
g_string_free(res, FALSE);
return resstr;
}
void