Commit 495377c4 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix #147651, reported by Oliver Guntermann:

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().
parent 059b48dd
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
......
......@@ -300,17 +300,27 @@ g_vasprintf (gchar **string,
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;
......@@ -328,3 +338,4 @@ g_vasprintf (gchar **string,
......@@ -39,10 +39,6 @@
#define _g_vsprintf vsprintf
#define _g_vsnprintf vsnprintf
#ifdef HAVE_VASPRINTF
#define _g_vasprintf vasprintf
#endif
#else
#include "gnulib/printf.h"
......@@ -57,8 +53,6 @@
#define _g_vsprintf _g_gnulib_vsprintf
#define _g_vsnprintf _g_gnulib_vsnprintf
#define _g_vasprintf _g_gnulib_vasprintf
#endif
#endif /* __G_PRINTF_H__ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment