diff options
author | Sean McBride <sean@rogue-research.com> | 2024-02-20 17:19:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 17:19:50 (GMT) |
commit | 7aed6abd527e88243a450c7809cde6003de1cb6f (patch) | |
tree | b1fd5656a5922d95f78e211ed75b7bb04b19b2a1 /src/H5Oattr.c | |
parent | f73da83a94f6fe563ff351603aa4d34525ef612b (diff) | |
download | hdf5-7aed6abd527e88243a450c7809cde6003de1cb6f.zip hdf5-7aed6abd527e88243a450c7809cde6003de1cb6f.tar.gz hdf5-7aed6abd527e88243a450c7809cde6003de1cb6f.tar.bz2 |
Replaced last sprintf with snprintf (#4007)
* Replaced last sprintf with snprintf
To have the size of the buffer, it was required to change a function signature, and change all users of it.
In most cases, determining the buffer size wasn't trivial and so SIZE_MAX is passed. But at least this improves the infrastructure. Someone can later figure out the correct sizes.
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r-- | src/H5Oattr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e86ec39..6852ebc 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -380,7 +380,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) p += name_len; /* encode the attribute datatype */ - if ((H5O_MSG_DTYPE->encode)(f, false, p, attr->shared->dt) < 0) + if ((H5O_MSG_DTYPE->encode)(f, false, SIZE_MAX, p, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute datatype"); if (attr->shared->version < H5O_ATTR_VERSION_2) { @@ -391,7 +391,7 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) p += attr->shared->dt_size; /* encode the attribute dataspace */ - if ((H5O_MSG_SDSPACE->encode)(f, false, p, &(attr->shared->ds->extent)) < 0) + if ((H5O_MSG_SDSPACE->encode)(f, false, SIZE_MAX, p, &(attr->shared->ds->extent)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute dataspace"); if (attr->shared->version < H5O_ATTR_VERSION_2) { |