mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
Use memcpy in g_string_append_vprintf (#57693).
2007-06-22 Mathias Hasselmann <mathias.hasselmann@gmx.de> * glib/gstring.c: Use memcpy in g_string_append_vprintf (#57693). svn path=/trunk/; revision=5584
This commit is contained in:
parent
c3a9f320c0
commit
c36ffea807
@ -1,3 +1,7 @@
|
||||
2007-06-22 Mathias Hasselmann <mathias.hasselmann@gmx.de>
|
||||
|
||||
* glib/gstring.c: Use memcpy in g_string_append_vprintf (#57693).
|
||||
|
||||
2007-06-18 Mathias Hasselmann <mathias.hasselmann@gmx.de>
|
||||
|
||||
* glib/gstring.c: Restore old behaviour of
|
||||
|
@ -1278,15 +1278,21 @@ g_string_append_vprintf (GString *string,
|
||||
const gchar *fmt,
|
||||
va_list args)
|
||||
{
|
||||
gchar *buffer;
|
||||
gint length;
|
||||
gchar *buf;
|
||||
gint len;
|
||||
|
||||
g_return_if_fail (string != NULL);
|
||||
g_return_if_fail (fmt != NULL);
|
||||
|
||||
length = g_vasprintf (&buffer, fmt, args);
|
||||
g_string_append_len (string, buffer, length);
|
||||
g_free (buffer);
|
||||
len = g_vasprintf (&buf, fmt, args);
|
||||
|
||||
if (len >= 0)
|
||||
{
|
||||
g_string_maybe_expand (string, len);
|
||||
memcpy (string->str + string->len, buf, len + 1);
|
||||
string->len += len;
|
||||
g_free (buf);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user