about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/chatwin.c5
-rw-r--r--src/ui/mucwin.c12
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
/a> 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190