When using the vsnprintf() implementation, '\0'-terminate the resulting

1999-04-20  Havoc Pennington  <hp@pobox.com>

	* gutils.c (g_vsnprintf):  When using the vsnprintf()
		implementation, '\0'-terminate the resulting string
			and return its length rather than -1.
This commit is contained in:
Havoc Pennington
1999-04-20 19:07:12 +00:00
committed by Havoc Pennington
parent ca97a570cd
commit dfa88ed86d
10 changed files with 60 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -1,3 +1,9 @@
1999-04-20 Havoc Pennington <hp@pobox.com>
* gutils.c (g_vsnprintf): When using the vsnprintf()
implementation, '\0'-terminate the resulting string
and return its length rather than -1.
Mon Apr 19 13:42:21 1999 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_iterate): Added missing

View File

@@ -175,6 +175,12 @@ g_vsnprintf (gchar *str,
retval = vsnprintf (str, n, fmt, args);
if (retval < 0)
{
str[n-1] = '\0';
retval = strlen (str);
}
return retval;
#else /* !HAVE_VSNPRINTF */
gchar *printed;

View File

@@ -175,6 +175,12 @@ g_vsnprintf (gchar *str,
retval = vsnprintf (str, n, fmt, args);
if (retval < 0)
{
str[n-1] = '\0';
retval = strlen (str);
}
return retval;
#else /* !HAVE_VSNPRINTF */
gchar *printed;