summaryrefslogtreecommitdiffstats
path: root/src/H5Orefcount.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2024-02-20 17:19:50 (GMT)
committerGitHub <noreply@github.com>2024-02-20 17:19:50 (GMT)
commit7aed6abd527e88243a450c7809cde6003de1cb6f (patch)
treeb1fd5656a5922d95f78e211ed75b7bb04b19b2a1 /src/H5Orefcount.c
parentf73da83a94f6fe563ff351603aa4d34525ef612b (diff)
downloadhdf5-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/H5Orefcount.c')
-rw-r--r--src/H5Orefcount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c
index 426d2be..a93f429 100644
--- a/src/H5Orefcount.c
+++ b/src/H5Orefcount.c
@@ -29,7 +29,8 @@
/* PRIVATE PROTOTYPES */
static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O__refcount_encode(H5F_t *f, bool disable_shared, uint8_t *p, const void *_mesg);
+static herr_t H5O__refcount_encode(H5F_t *f, bool disable_shared, size_t H5_ATTR_UNUSED p_size, uint8_t *p,
+ const void *_mesg);
static void *H5O__refcount_copy(const void *_mesg, void *_dest);
static size_t H5O__refcount_size(const H5F_t *f, bool disable_shared, const void *_mesg);
static herr_t H5O__refcount_free(void *_mesg);
@@ -126,8 +127,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, bool H5_ATTR_UNUSED disable_shared,
+ size_t H5_ATTR_UNUSED p_size, uint8_t *p, const void *_mesg)
{
const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg;