summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index b7d4dd5..2697959 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -328,8 +328,9 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
UINT16ENCODE(p, attr->shared->ds_size);
/* The character encoding for the attribute's name, in later versions */
- if(attr->shared->version >= H5O_ATTR_VERSION_3)
- *p++ = (uint8_t)attr->shared->encoding;
+ if(attr->shared->version >= H5O_ATTR_VERSION_3) {
+ ASSIGN_TO_SMALLER_SIZE(*p++, uint8_t, attr->shared->encoding, int);
+ }
/* Write the name including null terminator */
H5MM_memcpy(p, attr->shared->name, name_len);