summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-06-16 20:00:13 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-07-07 15:49:55 (GMT)
commit62dbb80cb6aa770bba771f57cea4643217b509d3 (patch)
treea0e9b53a317c7ec492ab628bf57e9091e68358ad /src
parent90466630ea7e7d0bb5677c4ed44aaf7572e0ca71 (diff)
downloadhdf5-62dbb80cb6aa770bba771f57cea4643217b509d3.zip
hdf5-62dbb80cb6aa770bba771f57cea4643217b509d3.tar.gz
hdf5-62dbb80cb6aa770bba771f57cea4643217b509d3.tar.bz2
Fix va_list usage in the vasprintf(3) implementation.
Diffstat (limited to 'src')
-rw-r--r--src/H5system.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5system.c b/src/H5system.c
index f5c3fae..6722488 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -77,13 +77,18 @@ static hbool_t H5_ntzset = FALSE;
* unavailable.
*/
int
-HDvasprintf(char **bufp, const char *fmt, va_list ap)
+HDvasprintf(char **bufp, const char *fmt, va_list _ap)
{
char *buf; /* buffer to receive formatted string */
size_t bufsz; /* size of buffer to allocate */
for (bufsz = 32; (buf = HDmalloc(bufsz)) != NULL; ) {
- const int ret = HDvsnprintf(buf, bufsz, fmt, ap);
+ int ret;
+ va_list ap;
+
+ va_copy(ap, _ap);
+ ret = HDvsnprintf(buf, bufsz, fmt, ap);
+ va_end(ap);
if (ret >= 0 && (size_t)ret < bufsz) {
*bufp = buf;
return ret;