From: Benjamin Otte Date: Thu, 1 May 2003 16:36:27 +0000 (+0000) Subject: added GST_STR_NULL to check for NULL strings. Fixed a case where a char* given to... X-Git-Tag: BRANCH-ERROR-ROOT~254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c57955fc68c9b45debb9a14168e94226aeeba9de;p=platform%2Fupstream%2Fgstreamer.git 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. --- 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; } -