diff options
author | Michael Vetter <jubalh@iodoru.org> | 2023-03-23 10:23:51 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2023-03-23 10:33:50 +0100 |
commit | ac440e72d7dac25c1114556d863d8bcac40fe216 (patch) | |
tree | 870e60aa8c3daa0368b807c966b880b807817e27 /src/ui | |
parent | 12b997c5f34776f34634d4ca155a14586aebc905 (diff) | |
download | profani-tty-ac440e72d7dac25c1114556d863d8bcac40fe216.tar.gz |
Adapt to new g_string_free() usage
Somehow this must have been overlooked when doing e59c401c840f379e64945734969db03b0e55ef22.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/chatwin.c | 5 | ||||
-rw-r--r-- | src/ui/mucwin.c | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 399d0fe0..ff425c0f 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -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 diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index a3d154e0..a4bcc191 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -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 |