[gtk+] Avoid a segfault if license is NULL



commit 079cc2195603110ff021aebb8a8710fdd1d2907b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 4 18:22:30 2009 -0400

    Avoid a segfault if license is NULL
    
    The license field was introduced later on, so some out-of-tree loaders
    may not set it. And Solaris printf() doesn't take NULL for a string...
    Bug 594178.

 gdk-pixbuf/queryloaders.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
index ba81638..71805d4 100644
--- a/gdk-pixbuf/queryloaders.c
+++ b/gdk-pixbuf/queryloaders.c
@@ -119,17 +119,20 @@ loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *v
 	return 0;
 }
 
-static void 
+static void
 write_loader_info (const char *path, GdkPixbufFormat *info)
 {
 	const GdkPixbufModulePattern *pattern;
-	char **mime; 
-	char **ext; 
+	char **mime;
+	char **ext;
 
 	g_printf("\"%s\"\n", path);
-	g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n", 
-		  info->name, info->flags, 
-		  info->domain ? info->domain : GETTEXT_PACKAGE, info->description, info->license);
+	g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
+		  info->name,
+                  info->flags,
+		  info->domain ? info->domain : GETTEXT_PACKAGE,
+                  info->description,
+                  info->license ? info->license : "");
 	for (mime = info->mime_types; *mime; mime++) {
 		g_printf ("\"%s\" ", *mime);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]