From 2785c61b8daddefe90c38f7e57d75957d906e8b8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 28 Aug 2007 10:21:59 -0500 Subject: [svn-r14116] Description: Fix error in end_obj() macro to make it safer in situations without enclosing braces. Tested on: Mac OS X/32 10.4.10 (amazon) --- tools/h5dump/h5dump.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index ec89210..0f863f8 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -36,14 +36,16 @@ const char *progname = "h5dump"; } while(0); #define end_obj(obj,end) \ - if(HDstrlen(end)) { \ - printf("%s", end); \ + do { \ + if(HDstrlen(end)) { \ + printf("%s", end); \ + if(HDstrlen(obj)) \ + printf(" "); \ + } \ if(HDstrlen(obj)) \ - printf(" "); \ - } \ - if(HDstrlen(obj)) \ - printf("%s", obj); \ - printf("\n"); + printf("%s", obj); \ + printf("\n"); \ + } while(0); /* 3 private values: can't be set, but can be read. Note: these are defined in H5Zprivate, they are -- cgit v0.12