From 2e0552a0ca6e6253f82afef55bc1897803e86efb Mon Sep 17 00:00:00 2001 From: handa Date: Sun, 29 Jun 2008 13:15:31 +0000 Subject: [PATCH] (dump_device_table): Handle an invalid table. --- example/otfdump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/example/otfdump.c b/example/otfdump.c index 5189771..a34cd77 100644 --- a/example/otfdump.c +++ b/example/otfdump.c @@ -306,10 +306,14 @@ dump_device_table (int indent, char *title, OTF_DeviceTable *table) indent++; IPRINT ("(StartSize %d) (EndSize %d) (DeltaFormat %d)", table->StartSize, table->EndSize, table->DeltaFormat); - IPRINT ("(DeltaValue"); - for (i = 0; i < table->EndSize - table->StartSize + 1; i++) - printf (" %d", table->DeltaValue[i]); - printf ("))"); + if (table->DeltaValue) + { + IPRINT ("(DeltaValue"); + for (i = 0; i < table->EndSize - table->StartSize + 1; i++) + printf (" %d", table->DeltaValue[i]); + printf (")"); + } + printf (")"); } -- 1.7.10.4