summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-08-02 20:46:24 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-08-02 20:46:24 (GMT)
commite7f24ebee381787cc0462ada5434ef90a74fc796 (patch)
treeb635a767044357d7d08b896b43e4783fe1a646ee
parent34fa342bab4fb85ef86198b1d55d3de8a26cf72f (diff)
downloadhdf5-e7f24ebee381787cc0462ada5434ef90a74fc796.zip
hdf5-e7f24ebee381787cc0462ada5434ef90a74fc796.tar.gz
hdf5-e7f24ebee381787cc0462ada5434ef90a74fc796.tar.bz2
[svn-r4308]
Purpose: Bug Fix Description: Back ported the bug fix which handles the "long long" type in HDfprintf(). Platforms tested: Linux
-rw-r--r--src/H5.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/H5.c b/src/H5.c
index 0eb9712..7f41908 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -17,8 +17,8 @@
#include "H5Bprivate.h" /*B-link trees */
#include "H5Dprivate.h" /*datasets */
#include "H5Eprivate.h" /*error handling */
-#include "H5FDprivate.h" /*file driver */
-#include "H5FLprivate.h" /*Free Lists */
+#include "H5FDprivate.h" /*file driver */
+#include "H5FLprivate.h" /*free lists */
#include "H5Iprivate.h" /*atoms */
#include "H5MMprivate.h" /*memory management */
#include "H5Pprivate.h" /*property lists */
@@ -728,7 +728,7 @@ HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...)
int
HDvsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
- return vsprintf(buf, fmt, ap);
+ return HDvsprintf(buf, fmt, ap);
}
#endif /* H5_HAVE_VSNPRINTF */
@@ -794,7 +794,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
fmt += 2;
nout++;
} else if ('%'==fmt[0]) {
- s = fmt+1;
+ s = fmt + 1;
/* Flags */
while (HDstrchr ("-+ #", *s)) {
@@ -843,7 +843,7 @@ HDfprintf (FILE *stream, const char *fmt, ...)
}
/* Type modifier */
- if (HDstrchr ("ZHhlq", *s)) {
+ if (HDstrchr ("ZHhlqL", *s)) {
switch (*s) {
case 'H':
if (sizeof(hsize_t)<sizeof(long)) {
@@ -863,11 +863,20 @@ HDfprintf (FILE *stream, const char *fmt, ...)
HDstrcpy (modifier, PRINTF_LL_WIDTH);
}
break;
-
default:
- modifier[0] = *s;
- modifier[1] = '\0';
- break;
+ /* Handle 'll' for long long types */
+ if(*s=='l' && *(s+1)=='l') {
+ modifier[0] = *s;
+ modifier[1] = *s;
+ modifier[2] = '\0';
+ s++; /* Increment over first 'l', second is taken care
+ * of below */
+ } /* end if */
+ else {
+ modifier[0] = *s;
+ modifier[1] = '\0';
+ } /* end else */
+ break;
}
s++;
}