summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-28 15:21:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-28 15:21:59 (GMT)
commit2785c61b8daddefe90c38f7e57d75957d906e8b8 (patch)
tree77abb63dca6f39f7930b7975675e7878ea8439a8
parentea343ef85416b42f68f28fb1024702c6726f7eea (diff)
downloadhdf5-2785c61b8daddefe90c38f7e57d75957d906e8b8.zip
hdf5-2785c61b8daddefe90c38f7e57d75957d906e8b8.tar.gz
hdf5-2785c61b8daddefe90c38f7e57d75957d906e8b8.tar.bz2
[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)
-rw-r--r--tools/h5dump/h5dump.c16
1 files 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