+2004-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ Fix #147651, reported by Oliver Guntermann:
+
+ * glib/gprintfint.h (_g_vasprintf): Don't wrap vasprintf(),
+ _g_gnulib_vasprintf() in a macro, since they behave
+ differently wrt. to memory allocation.
+
+ * glib/gprintf.c (g_vasprintf): Instead, differentiate
+ here between the three cases: system vasprintf(),
+ _g_gnulib_vasprintf(), no vasprintf().
+
2004-07-20 Crispin Flowerday <gnome@flowerday.cx>
* NEWS: Fix a typo in my name
+2004-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ Fix #147651, reported by Oliver Guntermann:
+
+ * glib/gprintfint.h (_g_vasprintf): Don't wrap vasprintf(),
+ _g_gnulib_vasprintf() in a macro, since they behave
+ differently wrt. to memory allocation.
+
+ * glib/gprintf.c (g_vasprintf): Instead, differentiate
+ here between the three cases: system vasprintf(),
+ _g_gnulib_vasprintf(), no vasprintf().
+
2004-07-20 Crispin Flowerday <gnome@flowerday.cx>
* NEWS: Fix a typo in my name
+2004-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ Fix #147651, reported by Oliver Guntermann:
+
+ * glib/gprintfint.h (_g_vasprintf): Don't wrap vasprintf(),
+ _g_gnulib_vasprintf() in a macro, since they behave
+ differently wrt. to memory allocation.
+
+ * glib/gprintf.c (g_vasprintf): Instead, differentiate
+ here between the three cases: system vasprintf(),
+ _g_gnulib_vasprintf(), no vasprintf().
+
2004-07-20 Crispin Flowerday <gnome@flowerday.cx>
* NEWS: Fix a typo in my name
+2004-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ Fix #147651, reported by Oliver Guntermann:
+
+ * glib/gprintfint.h (_g_vasprintf): Don't wrap vasprintf(),
+ _g_gnulib_vasprintf() in a macro, since they behave
+ differently wrt. to memory allocation.
+
+ * glib/gprintf.c (g_vasprintf): Instead, differentiate
+ here between the three cases: system vasprintf(),
+ _g_gnulib_vasprintf(), no vasprintf().
+
2004-07-20 Crispin Flowerday <gnome@flowerday.cx>
* NEWS: Fix a typo in my name
+2004-07-21 Matthias Clasen <mclasen@redhat.com>
+
+ Fix #147651, reported by Oliver Guntermann:
+
+ * glib/gprintfint.h (_g_vasprintf): Don't wrap vasprintf(),
+ _g_gnulib_vasprintf() in a macro, since they behave
+ differently wrt. to memory allocation.
+
+ * glib/gprintf.c (g_vasprintf): Instead, differentiate
+ here between the three cases: system vasprintf(),
+ _g_gnulib_vasprintf(), no vasprintf().
+
2004-07-20 Crispin Flowerday <gnome@flowerday.cx>
* NEWS: Fix a typo in my name
gint len;
g_return_val_if_fail (string != NULL, -1);
-#ifdef _g_vasprintf
- len = _g_vasprintf (string, format, args);
+#if !defined(HAVE_GOOD_PRINTF)
+
+ len = _g_gnulib_vasprintf (string, format, args);
+ if (len < 0)
+ *string = NULL;
+
+#elif defined (HAVE_VASPRINTF)
+
+ len = vasprintf (string, format, args);
if (len < 0)
*string = NULL;
else if (!g_mem_is_system_malloc ())
{
+ /* vasprintf returns malloc-allocated memory */
gchar *string1 = g_strndup (*string, len);
free (*string);
*string = string1;
}
+
#else
+
{
va_list args2;
+
#define _g_vsprintf vsprintf
#define _g_vsnprintf vsnprintf
-#ifdef HAVE_VASPRINTF
-#define _g_vasprintf vasprintf
-#endif
-
#else
#include "gnulib/printf.h"
#define _g_vsprintf _g_gnulib_vsprintf
#define _g_vsnprintf _g_gnulib_vsnprintf
-#define _g_vasprintf _g_gnulib_vasprintf
-
#endif
#endif /* __G_PRINTF_H__ */