mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-01 23:26:16 +01:00
handle NULL arguments gracefully.
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org> * glib/gstrfuncs.c (g_strconcat): handle NULL arguments gracefully. * glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the current function (since G_STRLOC and G_GNUC_*FUNCTION became unusable with gcc-3.0).
This commit is contained in:
parent
0642df0ab3
commit
5d49a7caf7
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -1,3 +1,12 @@
|
||||
Thu Nov 27 17:04:08 2003 Tim Janik <timj@gtk.org>
|
||||
|
||||
* glib/gstrfuncs.c (g_strconcat): handle NULL arguments
|
||||
gracefully.
|
||||
|
||||
* glib/gmacros.h: defined G_STRFUNC, which (pretty) prints the
|
||||
current function (since G_STRLOC and G_GNUC_*FUNCTION became
|
||||
unusable with gcc-3.0).
|
||||
|
||||
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||
|
@ -88,6 +88,7 @@
|
||||
|
||||
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
|
||||
* macros, so we can refer to them as strings unconditionally.
|
||||
* usage not-recommended since gcc-3.0
|
||||
*/
|
||||
#if defined (__GNUC__) && (__GNUC__ < 3)
|
||||
#define G_GNUC_FUNCTION __FUNCTION__
|
||||
@ -107,6 +108,15 @@
|
||||
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
|
||||
#endif
|
||||
|
||||
/* Provide a string identifying the current function, non-concatenatable */
|
||||
#if defined (__GNUC__)
|
||||
# define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
|
||||
#elif defined (G_HAVE_ISO_VARARGS)
|
||||
# define G_STRFUNC ((const char*) (__func__))
|
||||
#elif
|
||||
# define G_STRFUNC ((const char*) ("???"))
|
||||
#endif
|
||||
|
||||
/* Guard C code in headers, while including them from C++ */
|
||||
#ifdef __cplusplus
|
||||
# define G_BEGIN_DECLS extern "C" {
|
||||
|
@ -214,7 +214,8 @@ g_strconcat (const gchar *string1, ...)
|
||||
gchar *concat;
|
||||
gchar *ptr;
|
||||
|
||||
g_return_val_if_fail (string1 != NULL, NULL);
|
||||
if (!string1)
|
||||
return NULL;
|
||||
|
||||
l = 1 + strlen (string1);
|
||||
va_start (args, string1);
|
||||
|
Loading…
Reference in New Issue
Block a user