From: Keith Packard Date: Thu, 27 Feb 2003 07:04:31 +0000 (+0000) Subject: Avoid crashing with null expressions in debug code X-Git-Tag: fc-2_1_91~18 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=662b879681f2961b446341638c7bec048edd612a;p=fontconfig.git Avoid crashing with null expressions in debug code --- diff --git a/src/fcdbg.c b/src/fcdbg.c index 06181d1..6732045 100644 --- a/src/fcdbg.c +++ b/src/fcdbg.c @@ -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;