diff options
Diffstat (limited to 'tools/src/h5dump')
-rw-r--r-- | tools/src/h5dump/h5dump.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index a82dbb2..84669a2 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -1314,23 +1314,28 @@ end_collect: } } - /* Copy the VFD driver info for the input file if it's the onion file */ - if (vfd_info_g.u.name) { - if (!HDstrcmp(vfd_info_g.u.name, "onion")) { - onion_fa_g.revision_num = 0; + /* If the file uses the onion VFD, get the revision number */ + if (vfd_info_g.u.name && !HDstrcmp(vfd_info_g.u.name, "onion")) { - if (vfd_info_g.info) { - if (!HDstrcmp(vfd_info_g.info, "revision_count")) - get_onion_revision_count = TRUE; - else { - onion_fa_g.revision_num = HDstrtoull((const char *)(vfd_info_g.info), NULL, 0); - HDprintf("Using revision %" PRIu64 "\n", onion_fa_g.revision_num); + if (vfd_info_g.info) { + if (!HDstrcmp(vfd_info_g.info, "revision_count")) + get_onion_revision_count = TRUE; + else { + errno = 0; + onion_fa_g.revision_num = HDstrtoull(vfd_info_g.info, NULL, 10); + if (errno == ERANGE) { + HDprintf("Invalid onion revision specified\n"); + goto error; } - } - vfd_info_g.info = &onion_fa_g; + HDprintf("Using revision %" PRIu64 "\n", onion_fa_g.revision_num); + } } - } /* driver name defined */ + else + onion_fa_g.revision_num = 0; + + vfd_info_g.info = &onion_fa_g; + } parse_end: /* check for file name to be processed */ |