xeme/xeme

Fix a warning related to GString

10 months ago, Gary Kramlich
e7cbbf03100e
Parents 6897bb92c387
Children 2beb2b34bcb5
Fix a warning related to GString

Also use a g_string_free_to_bytes instead of doing the same thing manually.
--- a/dodo/dodooutputstream.c Sun Aug 06 02:07:01 2023 -0500
+++ b/dodo/dodooutputstream.c Sun Aug 06 02:07:37 2023 -0500
@@ -36,7 +36,6 @@
static GBytes *
dodo_output_stream_serialize(DodoOutputStream *output_stream) {
DodoStream *stream = DODO_STREAM(output_stream);
- GBytes *bytes = NULL;
GString *str = NULL;
const char *value = NULL;
@@ -71,10 +70,7 @@
/* Create a GBytes with the value from the GString and free the GString
* container.
*/
- bytes = g_bytes_new_take(str->str, str->len);
- g_string_free(str, FALSE);
-
- return bytes;
+ return g_string_free_to_bytes(str);
}
/******************************************************************************