summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5A.c b/src/H5A.c
index b7852ea..c308611 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -398,6 +398,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open")
attr->obj_opened = TRUE;
+ /* Set the version to encode the attribute with */
+ attr->version = H5A_get_version(attr->oloc.file, attr);
+
/* Insert the attribute into the object header */
if(H5O_attr_create(&(attr->oloc), dxpl_id, attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create attribute in object header")