mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r9837] Purpose:
Bug fix Description: Calling HDvsnprintf() several times (should be twice) is incorrect without calling va_end() and va_start() again. Solution: Call va_end() and va_start() before calling HDvsnprintf() again. Platforms tested: Linux 2.4/x86_64 (mir) Too minor to require h5committest
This commit is contained in:
parent
7b10edb121
commit
b8f7cdc48d
@ -1523,7 +1523,14 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line
|
||||
|
||||
/* If the description doesn't fit into the initial buffer size, allocate more space and try again */
|
||||
while((desc_len=HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap))>tmp_len) {
|
||||
/* shutdown & restart the va_list */
|
||||
va_end(ap);
|
||||
va_start(ap, fmt);
|
||||
|
||||
/* Release the previous description, it's too small */
|
||||
H5MM_xfree(tmp);
|
||||
|
||||
/* Allocate a description of the appropriate length */
|
||||
tmp_len = desc_len+1;
|
||||
if((tmp=H5MM_malloc((size_t)tmp_len))==NULL)
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
|
||||
|
Loading…
x
Reference in New Issue
Block a user