diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-10-30 20:24:19 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-10-30 20:24:19 (GMT) |
commit | c19a43d85474fc21308cb3e5e59dbc535edf4174 (patch) | |
tree | 0a269c5f1be8e1c2d5cf3fc9de437d9d2cda8b4f /tools | |
parent | 780fefb82913150a4f95ca25e8d72758e764dbad (diff) | |
download | hdf5-c19a43d85474fc21308cb3e5e59dbc535edf4174.zip hdf5-c19a43d85474fc21308cb3e5e59dbc535edf4174.tar.gz hdf5-c19a43d85474fc21308cb3e5e59dbc535edf4174.tar.bz2 |
[svn-r12831] Changed the API for "unpacking" an external link value to take the size of
the linkval buffer, per Elena and Frank's suggestions while revising
the documentation. Added error checking using this size, as well as a
couple of tests.
Tested on juniper, kagiso, and sol.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/h5dump.c | 4 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 2 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 3f51f81..384b765 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1560,7 +1560,7 @@ dump_all(hid_t group, const char *name, void * op_data) d_status = EXIT_FAILURE; ret = FAIL; } else { - if(H5Lunpack_elink_val(targbuf, &filename, &targname) < 0) { + if(H5Lunpack_elink_val(targbuf, statbuf.linklen, &filename, &targname) < 0) { error_msg(progname, "unable to unpack external link value\n"); d_status = EXIT_FAILURE; ret = FAIL; @@ -3248,7 +3248,7 @@ handle_links(hid_t fid, char *links, void UNUSED * data) begin_obj(dump_header_format->extlinkbegin, links, dump_header_format->extlinkblockbegin); if (H5Lget_linkval(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) { - if(H5Lunpack_elink_val(buf, &elink_file, &elink_path)>=0) { + if(H5Lunpack_elink_val(buf, statbuf.linklen, &elink_file, &elink_path)>=0) { indentation(COL); printf("LINKCLASS %d\n", linfo.type); indentation(COL); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 04a9371..d34cae0 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1764,7 +1764,7 @@ udlink_open(hid_t location, const char *name) if ((buf = HDmalloc(linfo.u.link_size))==NULL) goto error; if (H5Lget_linkval (location, name, sizeof(buf), buf, H5P_DEFAULT)<0) goto error; - if(H5Lunpack_elink_val(buf, &filename, &path) < 0) goto error; + if(H5Lunpack_elink_val(buf, linfo.u.link_size, &filename, &path) < 0) goto error; fputs("file: ", stdout); fputs(filename, stdout); fputs(" path: ", stdout); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 8a6173c..8480f57 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -521,7 +521,7 @@ static int traverse( hid_t loc_id, targbuf = HDmalloc(statbuf.linklen); assert(targbuf); H5Gget_linkval(loc_id,path,statbuf.linklen,targbuf); - H5Lunpack_elink_val(targbuf, NULL, &objname); + H5Lunpack_elink_val(targbuf, statbuf.linklen, NULL, &objname); if (print) printf(" %-10s %s -> %s %s\n", "ext link", path, targbuf, objname); free(targbuf); |