]> git.wh0rd.org Git - fontconfig.git/commitdiff
Avoid crashing with null expressions in debug code
authorKeith Packard <keithp@keithp.com>
Thu, 27 Feb 2003 07:04:31 +0000 (07:04 +0000)
committerKeith Packard <keithp@keithp.com>
Thu, 27 Feb 2003 07:04:31 +0000 (07:04 +0000)
src/fcdbg.c

index 06181d1efa7f2603f594907cc7c03633e995b39c..673204544003ebc8ea28fb6254d55dd779ce20ce 100644 (file)
@@ -153,7 +153,8 @@ FcOpPrint (FcOp op)
 void
 FcExprPrint (const FcExpr *expr)
 {
-    switch (expr->op) {
+    if (!expr) printf ("none");
+    else switch (expr->op) {
     case FcOpInteger: printf ("%d", expr->u.ival); break;
     case FcOpDouble: printf ("%g", expr->u.dval); break;
     case FcOpString: printf ("\"%s\"", expr->u.sval); break;