summaryrefslogtreecommitdiffstats
path: root/src/H5G.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-10-29 16:37:49 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-10-29 16:37:49 (GMT)
commit67a679af07ec8a032f32fe54af84e673c0c3b3ae (patch)
treecf68f80b61684b9cf00409b84bb4eda1cb662acd /src/H5G.c
parent0d1aba339eb7f0fd53282412289226896df1e988 (diff)
downloadhdf5-67a679af07ec8a032f32fe54af84e673c0c3b3ae.zip
hdf5-67a679af07ec8a032f32fe54af84e673c0c3b3ae.tar.gz
hdf5-67a679af07ec8a032f32fe54af84e673c0c3b3ae.tar.bz2
[svn-r6041]
Purpose: Bug fix Description: #340 - get comment length for H5G; #435 - H5Aget_storage_size; #644 - H5Arename Platforms tested: eirene, arabica
Diffstat (limited to 'src/H5G.c')
-rw-r--r--src/H5G.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5G.c b/src/H5G.c
index f6f0633..d08ac5b 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -2415,7 +2415,8 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf)
buf[0] = '\0';
ret_value = 0;
} else {
- HDstrncpy(buf, comment.s, bufsize);
+ if(buf && bufsize)
+ HDstrncpy(buf, comment.s, bufsize);
ret_value = (int)HDstrlen(comment.s);
H5O_reset(H5O_NAME, &comment);
}