summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Attribute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5Attribute.cpp')
-rw-r--r--c++/src/H5Attribute.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index a9e928d..6b5c753 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -392,10 +392,12 @@ H5std_string Attribute::getName() const
//--------------------------------------------------------------------------
H5std_string Attribute::getName(size_t len) const
{
- H5std_string attr_name;
- ssize_t name_size = getName(attr_name, len);
- return(attr_name);
- // let caller catch exception if any
+ H5std_string attr_name;
+ ssize_t name_size = getName(attr_name, len);
+ if (name_size < 0)
+ return("");
+ else
+ return(attr_name);
}
//--------------------------------------------------------------------------