Adapt to g_string_free glib 2.75.3 change
glib 2.75.3 changes warning behaviour of `g_string_free()`. See: * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3219 * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3226 Use this opportunity to replace the use of GString with `g_strdup_printf()` where possible. Otherwise correctly take the return value of `g_string_free()` which is nicer anyways.
This commit is contained in:
@@ -457,13 +457,7 @@ otr_key_loaded(void)
|
||||
char*
|
||||
otr_tag_message(const char* const msg)
|
||||
{
|
||||
GString* otr_message = g_string_new(msg);
|
||||
g_string_append(otr_message, OTRL_MESSAGE_TAG_BASE);
|
||||
g_string_append(otr_message, OTRL_MESSAGE_TAG_V2);
|
||||
char* result = otr_message->str;
|
||||
g_string_free(otr_message, FALSE);
|
||||
|
||||
return result;
|
||||
return g_strdup_printf("%s%s%s", msg, OTRL_MESSAGE_TAG_BASE, OTRL_MESSAGE_TAG_V2);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
Reference in New Issue
Block a user