summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dump.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index cf02a47..5f4842a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1463,8 +1463,11 @@ dump_selected_attr(hid_t loc_id, const char *name)
obj_name = (char *)HDmalloc((size_t)j + 2);
/* find the last / */
- while(name[j] != '/' && j >= 0)
+ while(j >= 0) {
+ if (name[j] == '/')
+ break;
j--;
+ }
/* object name */
if(j == -1)