From 662b879681f2961b446341638c7bec048edd612a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 27 Feb 2003 07:04:31 +0000 Subject: [PATCH] Avoid crashing with null expressions in debug code --- src/fcdbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5