summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_util.c16
-rw-r--r--tools/lib/ph5diff.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index c55028c..818a933 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -49,17 +49,20 @@ void parallel_print(const char* format, ...)
if(overflow_file == NULL) /*no overflow has occurred yet */
{
bytes_written = HDvsnprintf(outBuff+outBuffOffset, OUTBUFF_SIZE-outBuffOffset, format, ap);
-
- va_end(ap);
+
+ va_end(ap);
va_start(ap, format);
- if(bytes_written >= (OUTBUFF_SIZE-outBuffOffset))
+#ifdef VSNPRINTF_WORKS
+ if(bytes_written >= (OUTBUFF_SIZE-outBuffOffset))
+#else
+ if((bytes_written+1) == (OUTBUFF_SIZE-outBuffOffset))
+#endif
{
/* Delete the characters that were written to outBuff since they will be written to the overflow_file */
- memset(outBuff+outBuffOffset, 0, OUTBUFF_SIZE - outBuffOffset);
-
+ memset(outBuff+outBuffOffset, 0, OUTBUFF_SIZE - outBuffOffset);
+
overflow_file = tmpfile();
-
if(overflow_file == NULL)
printf("Warning: Could not create overflow file. Output may be truncated.\n");
else
@@ -71,7 +74,6 @@ void parallel_print(const char* format, ...)
else
bytes_written = HDvfprintf(overflow_file, format, ap);
-
}
va_end(ap);
}
diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h
index 44e5b26..911f354 100644
--- a/tools/lib/ph5diff.h
+++ b/tools/lib/ph5diff.h
@@ -17,7 +17,7 @@
#define PRINT_DATA_MAX_SIZE 512
-#define OUTBUFF_SIZE PRINT_DATA_MAX_SIZE*2
+#define OUTBUFF_SIZE PRINT_DATA_MAX_SIZE*4
/* Send from manager to workers */
#define MPI_TAG_ARGS 1
#define MPI_TAG_PRINT_TOK 2