debug.c: fix no-color-printing in case .color = NULL
diff --git a/src/debug.c b/src/debug.c
index 934f229..d10861f 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -115,7 +115,7 @@
 			return debug_info->cat[i].color;
 	}
 
-	return "";
+	return NULL;
 }
 
 static void _output(struct debug_target *target, unsigned int subsys,
@@ -136,8 +136,11 @@
 
 	/* are we using color */
 	if (target->use_color) {
-		snprintf(col, sizeof(col), "%s", color(subsys));
-		col[sizeof(col)-1] = '\0';
+		const char *c = color(subsys);
+		if (c) {
+			snprintf(col, sizeof(col), "%s", color(subsys));
+			col[sizeof(col)-1] = '\0';
+		}
 	}
 	vsnprintf(buf, sizeof(buf), format, ap);
 	buf[sizeof(buf)-1] = '\0';