mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-22 18:22:11 +01:00
When using the vsnprintf() implementation, '\0'-terminate the resulting
1999-04-18 Havoc Pennington <hp@pobox.com> * gutils.c (g_snprintf): When using the vsnprintf() implementation, '\0'-terminate the resulting string and return its length rather than -1.
This commit is contained in:
parent
cd49c36373
commit
f5722475f1
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -1,3 +1,9 @@
|
||||
1999-04-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* gutils.c (g_snprintf): When using the vsnprintf()
|
||||
implementation, '\0'-terminate the resulting string
|
||||
and return its length rather than -1.
|
||||
|
||||
Fri Apr 16 06:52:07 1999 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gscanner.c (g_scanner_unexp_token): feature G_TOKEN_EOF as a valid
|
||||
|
@ -140,6 +140,12 @@ g_snprintf (gchar *str,
|
||||
retval = vsnprintf (str, n, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
str[n-1] = '\0';
|
||||
retval = strlen (str);
|
||||
}
|
||||
|
||||
return retval;
|
||||
#else /* !HAVE_VSNPRINTF */
|
||||
gchar *printed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user