summaryrefslogtreecommitdiffstats
path: root/src/H5E.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-01-24 18:50:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-01-24 18:50:31 (GMT)
commit24c134e28b8f2229d91a5a48ac285bf6f5fc5b94 (patch)
tree235c6fcecfb37c439e38ebe7f5e83b6b74e839b1 /src/H5E.c
parent68e5b3e014da798e8959230106de917ca898e82f (diff)
downloadhdf5-24c134e28b8f2229d91a5a48ac285bf6f5fc5b94.zip
hdf5-24c134e28b8f2229d91a5a48ac285bf6f5fc5b94.tar.gz
hdf5-24c134e28b8f2229d91a5a48ac285bf6f5fc5b94.tar.bz2
[svn-r9865] Purpose:
Bug fix Description: Catch another way that vsnprintf() can fail (this time on the HP) and deal with that. Platforms tested: HP/UX 11.x (kelgia) Doesn't affect other platforms
Diffstat (limited to 'src/H5E.c')
-rw-r--r--src/H5E.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/H5E.c b/src/H5E.c
index 31d212f..20d3604 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -1384,7 +1384,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5E_pop(H5E_t *estack, size_t count)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1526,11 +1526,15 @@ 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))
#ifdef H5_VSNPRINTF_WORKS
- >
+ >
#else /* H5_VSNPRINTF_WORKS */
- >=
+ >=
+#endif /* H5_VSNPRINTF_WORKS */
+ (tmp_len-1)
+#ifndef H5_VSNPRINTF_WORKS
+ || desc_len<0
#endif /* H5_VSNPRINTF_WORKS */
- (tmp_len-1)) {
+ ) {
/* shutdown & restart the va_list */
va_end(ap);
va_start(ap, fmt);
@@ -1542,7 +1546,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line
#ifdef H5_VSNPRINTF_WORKS
tmp_len = desc_len+1;
#else /* H5_VSNPRINTF_WORKS */
- tmp_len = 2 * desc_len;
+ tmp_len = 2 * tmp_len;
#endif /* H5_VSNPRINTF_WORKS */
if((tmp=H5MM_malloc((size_t)tmp_len))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")