From: Bruno Haible Date: Thu, 12 Dec 2024 10:34:26 +0000 (+0100) Subject: libtextstyle: Fix a gcc 13 -Wunused-result warning. X-Git-Tag: v0.24~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b821580d893a5022b57ccb5c2bd7e58458bf2135;p=thirdparty%2Fgettext.git libtextstyle: Fix a gcc 13 -Wunused-result warning. * libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_strdup_vprintf): Don't assume that vasprintf leaves the pointed-to variable unchanged when it fails. --- diff --git a/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c b/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c index 75a87e5ee..e66e03176 100644 --- a/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c +++ b/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c @@ -1,5 +1,5 @@ /* GLIB - Library of useful routines for C programming - * Copyright (C) 2006-2023 Free Software Foundation, Inc. + * Copyright (C) 2006-2024 Free Software Foundation, Inc. * * This file is not part of the GNU gettext program, but is used with * GNU gettext. @@ -210,9 +210,10 @@ gchar* g_strdup_vprintf (const gchar *format, va_list args) { - gchar *string = NULL; + gchar *string; - g_vasprintf (&string, format, args); + if (g_vasprintf (&string, format, args) < 0) + return NULL; return string; }