From: Brian C. <yi...@us...> - 2003-07-26 05:21:32
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: yippi Date: Fri Jul 25 2003 07:31:28 PDT Log message: Properly handle null string value, preventing core dump on Solaris. Modified files: tools : gst-inspect.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/tools/gst-inspect.c.diff?r1=1.44&r2=1.45 ====Begin Diffs==== Index: gst-inspect.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/tools/gst-inspect.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- gst-inspect.c 29 Jun 2003 14:05:49 -0000 1.44 +++ gst-inspect.c 25 Jul 2003 14:31:15 -0000 1.45 @@ -252,7 +252,7 @@ GParamSpec **property_specs; gint num_properties,i; gboolean readable; - + const char *string_val; property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element), &num_properties); @@ -274,8 +274,14 @@ switch (G_VALUE_TYPE (&value)) { case G_TYPE_STRING: + string_val = g_value_get_string (&value); g_print ("%-23.23s String. ", ""); - if (readable) g_print ("(Default \"%s\")", g_value_get_string (&value)); + if (readable) { + if (string_val == NULL) + g_print ("(Default \"\")"); + else + g_print ("(Default \"%s\")", g_value_get_string (&value)); + } break; case G_TYPE_BOOLEAN: g_print ("%-23.23s Boolean. ", ""); |