From: Marek Vasut Date: Sat, 28 Oct 2023 07:12:48 +0000 (+0200) Subject: analog: Get GString content from proper API call X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b4645b0f70e6b2a2ed14f161ea12ff3dbe94391d;p=libsigrok.git analog: Get GString content from proper API call Use the g_string_free() routine's return value instead of pulling the string content out of the buffer structure bypassing the library's API. Signed-off-by: Marek Vasut --- diff --git a/src/analog.c b/src/analog.c index f5cc6285..76ea659c 100644 --- a/src/analog.c +++ b/src/analog.c @@ -492,8 +492,7 @@ SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog *analog, if (analog->meaning->mqflags & mq_strings[i].value) g_string_append(buf, mq_strings[i].str); - *result = buf->str; - g_string_free(buf, FALSE); + *result = g_string_free(buf, FALSE); return SR_OK; }