summaryrefslogtreecommitdiffstats
path: root/src/H5system.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5system.c')
-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;