Hello,

When you ask for the name of an object given the index, the result is
truncated of the last character.

I created a patch, which I posted to the Debian BTS at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=368974

The bug has been open without comments for a few months now, and I
assume that the Debian maintainer didn't forward the bug to you.

Since I'm regularly bitten by this bug and I'm tired of rebuilding
libhdf5 every time there is a Debian upgrade of the library, then I'll
have to bug you myself.

Please apply the patch: it's a trivial one, and it allows my code to
work :)


Best regards,

Enrico

--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <[EMAIL PROTECTED]>
diff -Naur hdf5-1.6.5.orig/c++/src/H5CommonFG.cpp 
hdf5-1.6.5/c++/src/H5CommonFG.cpp
--- hdf5-1.6.5.orig/c++/src/H5CommonFG.cpp      2005-10-01 17:30:03.000000000 
+0200
+++ hdf5-1.6.5/c++/src/H5CommonFG.cpp   2006-05-25 21:48:39.279154480 +0200
@@ -898,8 +898,8 @@
     }
 
     // now, allocate C buffer to get the name
-    char* name_C = new char[name_len];
-    name_len = H5Gget_objname_by_idx(getLocId(), idx, name_C, name_len);
+    char* name_C = new char[name_len + 1];
+    name_len = H5Gget_objname_by_idx(getLocId(), idx, name_C, name_len + 1);
 
     // clean up and return the string
     string name = string(name_C);

Attachment: signature.asc
Description: Digital signature

Reply via email to