summaryrefslogtreecommitdiffstats
path: root/c++/src/H5PropList.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-03-21 23:23:05 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-03-21 23:23:05 (GMT)
commit60df159d33d8793dd5764e2ae032e0e89fc44c9b (patch)
tree8a83268f8ee902901d982d33b380568a2962f9ab /c++/src/H5PropList.cpp
parent2e4302818ab260604ffa26e90dab159cf28079d4 (diff)
downloadhdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.zip
hdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.tar.gz
hdf5-60df159d33d8793dd5764e2ae032e0e89fc44c9b.tar.bz2
[svn-r24865] Description:
- Added another overload for char* argument: ssize_t getComment(const char* name, const size_t buf_size, char* comment) - Changed default value to 0 for the other two getComment methods - Added HDmemset to after every char string allocation to clear the buffer Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) Linux/64 2.6 (platypus)/PGI compilers
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r--c++/src/H5PropList.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 9476d46..a49995d 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -390,8 +390,13 @@ void PropList::getProperty(const char* name, void* value) const
//--------------------------------------------------------------------------
H5std_string PropList::getProperty(const char* name) const
{
+ // Get property size first
size_t size = getPropSize(name);
+
+ // Allocate buffer then get the property
char* prop_strg_C = new char[size+1]; // temporary C-string for C API
+ HDmemset(prop_strg_C, 0, size+1); // clear buffer
+
herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
// Throw exception if H5Pget returns failure