From c57955fc68c9b45debb9a14168e94226aeeba9de Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 1 May 2003 16:36:27 +0000 Subject: [PATCH] added GST_STR_NULL to check for NULL strings. Fixed a case where a char* given to printf was NULL to use that macro. Original commit message from CVS: added GST_STR_NULL to check for NULL strings. Fixed a case where a char* given to printf was NULL to use that macro. --- gst/gstinfo.h | 3 +++ gst/gstplugin.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/gstinfo.h b/gst/gstinfo.h index e7012d1..9793af8 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -32,6 +32,9 @@ #include #endif +/* This is needed in printf's if a char* might be NULL. Solaris crashes then */ +#define GST_STR_NULL(str) ((str) ? (str) : "(NULL)") + /* FIXME: convert to using G_STRLOC all the way if we can ! */ #ifndef FUNCTION diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 853691c..9401b66 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -111,7 +111,7 @@ gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, GModule *modul plugin->filename); return NULL; } - GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", plugin->filename); + GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", GST_STR_NULL (plugin->filename)); return plugin; } @@ -529,4 +529,3 @@ gst_library_load (const gchar *name) return res; } - -- 2.7.4