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.
This improves portability and readability, also happens to silence an
"ignoring return value" warning which is seen with GCC 13.2.0.
See https://docs.gtk.org/glib/method.String.free.html#return-value for
a discussion of the g_string_free() return value.
Signed-off-by: Marek Vasut <redacted>
}
}
- sdi->model = devname->str;
- sdi->version = version->str;
- g_string_free(devname, FALSE);
- g_string_free(version, FALSE);
+ sdi->model = g_string_free(devname, FALSE);
+ sdi->version = g_string_free(version, FALSE);
/* Optionally amend received metadata, model specific quirks. */
ols_metadata_quirks(sdi);
}
}
- sdi->model = devname->str;
- sdi->version = version->str;
- g_string_free(devname, FALSE);
- g_string_free(version, FALSE);
+ sdi->model = g_string_free(devname, FALSE);
+ sdi->version = g_string_free(version, FALSE);
return sdi;
}