mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 00:48:53 +02: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:
@@ -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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* 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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* 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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* 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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* 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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* 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>
|
Wed Nov 26 16:45:16 2003 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||||
|
|
||||||
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
* glib/gstrfuncs.c: Fixed a bad pointer comparison in
|
||||||
|
@@ -88,6 +88,7 @@
|
|||||||
|
|
||||||
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
|
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
|
||||||
* macros, so we can refer to them as strings unconditionally.
|
* macros, so we can refer to them as strings unconditionally.
|
||||||
|
* usage not-recommended since gcc-3.0
|
||||||
*/
|
*/
|
||||||
#if defined (__GNUC__) && (__GNUC__ < 3)
|
#if defined (__GNUC__) && (__GNUC__ < 3)
|
||||||
#define G_GNUC_FUNCTION __FUNCTION__
|
#define G_GNUC_FUNCTION __FUNCTION__
|
||||||
@@ -107,6 +108,15 @@
|
|||||||
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
|
# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__)
|
||||||
#endif
|
#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++ */
|
/* Guard C code in headers, while including them from C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# define G_BEGIN_DECLS extern "C" {
|
# define G_BEGIN_DECLS extern "C" {
|
||||||
|
@@ -214,7 +214,8 @@ g_strconcat (const gchar *string1, ...)
|
|||||||
gchar *concat;
|
gchar *concat;
|
||||||
gchar *ptr;
|
gchar *ptr;
|
||||||
|
|
||||||
g_return_val_if_fail (string1 != NULL, NULL);
|
if (!string1)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
l = 1 + strlen (string1);
|
l = 1 + strlen (string1);
|
||||||
va_start (args, string1);
|
va_start (args, string1);
|
||||||
|
Reference in New Issue
Block a user