added argument assertments.

Fri May 19 11:39:29 2000  Tim Janik  <timj@gtk.org>


        * gutils.c (g_snprintf):
        (g_vsnprintf): added argument assertments.

        * gstring.c (g_string_assign): added argument assertments.
        (g_string_truncate): make len a guint.
This commit is contained in:
Tim Janik 2000-05-19 10:01:08 +00:00 committed by Tim Janik
parent 1e5d06d4ce
commit 1fe02b28ad
14 changed files with 108 additions and 4 deletions

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

View File

@ -1,3 +1,12 @@
Fri May 19 11:39:29 2000 Tim Janik <timj@gtk.org>
* gutils.c (g_snprintf):
(g_vsnprintf): added argument assertments.
* gstring.c (g_string_assign): added argument assertments.
(g_string_truncate): make len a guint.
Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org>
* gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with

2
glib.h
View File

@ -1864,7 +1864,7 @@ void g_string_free (GString *string,
GString* g_string_assign (GString *string, GString* g_string_assign (GString *string,
const gchar *rval); const gchar *rval);
GString* g_string_truncate (GString *string, GString* g_string_truncate (GString *string,
gint len); guint len);
GString* g_string_insert_len (GString *string, GString* g_string_insert_len (GString *string,
gint pos, gint pos,
const gchar *val, const gchar *val,

View File

@ -1864,7 +1864,7 @@ void g_string_free (GString *string,
GString* g_string_assign (GString *string, GString* g_string_assign (GString *string,
const gchar *rval); const gchar *rval);
GString* g_string_truncate (GString *string, GString* g_string_truncate (GString *string,
gint len); guint len);
GString* g_string_insert_len (GString *string, GString* g_string_insert_len (GString *string,
gint pos, gint pos,
const gchar *val, const gchar *val,

View File

@ -280,7 +280,7 @@ g_string_assign (GString *string,
GString* GString*
g_string_truncate (GString *fstring, g_string_truncate (GString *fstring,
gint len) guint len)
{ {
GRealString *string = (GRealString *) fstring; GRealString *string = (GRealString *) fstring;

View File

@ -149,6 +149,10 @@ g_snprintf (gchar *str,
va_list args; va_list args;
gint retval; gint retval;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
va_start (args, fmt); va_start (args, fmt);
retval = vsnprintf (str, n, fmt, args); retval = vsnprintf (str, n, fmt, args);
va_end (args); va_end (args);
@ -164,6 +168,10 @@ g_snprintf (gchar *str,
gchar *printed; gchar *printed;
va_list args; va_list args;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
va_start (args, fmt); va_start (args, fmt);
printed = g_strdup_vprintf (fmt, args); printed = g_strdup_vprintf (fmt, args);
va_end (args); va_end (args);
@ -186,6 +194,10 @@ g_vsnprintf (gchar *str,
#ifdef HAVE_VSNPRINTF #ifdef HAVE_VSNPRINTF
gint retval; gint retval;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
retval = vsnprintf (str, n, fmt, args); retval = vsnprintf (str, n, fmt, args);
if (retval < 0) if (retval < 0)
@ -198,6 +210,10 @@ g_vsnprintf (gchar *str,
#else /* !HAVE_VSNPRINTF */ #else /* !HAVE_VSNPRINTF */
gchar *printed; gchar *printed;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
printed = g_strdup_vprintf (fmt, args); printed = g_strdup_vprintf (fmt, args);
strncpy (str, printed, n); strncpy (str, printed, n);
str[n-1] = '\0'; str[n-1] = '\0';

View File

@ -280,7 +280,7 @@ g_string_assign (GString *string,
GString* GString*
g_string_truncate (GString *fstring, g_string_truncate (GString *fstring,
gint len) guint len)
{ {
GRealString *string = (GRealString *) fstring; GRealString *string = (GRealString *) fstring;

View File

@ -149,6 +149,10 @@ g_snprintf (gchar *str,
va_list args; va_list args;
gint retval; gint retval;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
va_start (args, fmt); va_start (args, fmt);
retval = vsnprintf (str, n, fmt, args); retval = vsnprintf (str, n, fmt, args);
va_end (args); va_end (args);
@ -164,6 +168,10 @@ g_snprintf (gchar *str,
gchar *printed; gchar *printed;
va_list args; va_list args;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
va_start (args, fmt); va_start (args, fmt);
printed = g_strdup_vprintf (fmt, args); printed = g_strdup_vprintf (fmt, args);
va_end (args); va_end (args);
@ -186,6 +194,10 @@ g_vsnprintf (gchar *str,
#ifdef HAVE_VSNPRINTF #ifdef HAVE_VSNPRINTF
gint retval; gint retval;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
retval = vsnprintf (str, n, fmt, args); retval = vsnprintf (str, n, fmt, args);
if (retval < 0) if (retval < 0)
@ -198,6 +210,10 @@ g_vsnprintf (gchar *str,
#else /* !HAVE_VSNPRINTF */ #else /* !HAVE_VSNPRINTF */
gchar *printed; gchar *printed;
g_return_val_if_fail (str != NULL, 0);
g_return_val_if_fail (n > 0, 0);
g_return_val_if_fail (fmt != NULL, 0);
printed = g_strdup_vprintf (fmt, args); printed = g_strdup_vprintf (fmt, args);
strncpy (str, printed, n); strncpy (str, printed, n);
str[n-1] = '\0'; str[n-1] = '\0';