summaryrefslogtreecommitdiffstats
path: root/src/H5.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-11-24 15:53:55 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-11-24 15:53:55 (GMT)
commit0dfd13d13b2587cbdc3388a205159c25eb83588f (patch)
tree9a5b5fea712a6c8a12712762784dc848c548d6e3 /src/H5.c
parent9db8ce23f6d3014ff6b2901580faa37bdecae4fa (diff)
downloadhdf5-0dfd13d13b2587cbdc3388a205159c25eb83588f.zip
hdf5-0dfd13d13b2587cbdc3388a205159c25eb83588f.tar.gz
hdf5-0dfd13d13b2587cbdc3388a205159c25eb83588f.tar.bz2
[svn-r946] Changes since 19981121
---------------------- ./src/H5Tconv.c With my poor eyesight I missed the definitions of SCHAR_MIN and SCHAR_MAX in <limits.h> and used CHAR_MIN and CHAR_MAX incorrectly. I changed all occurrences of the latter to the former and the new hardware integer type conversions now work on Irix. ./configure.in ./configure [REGENERATED] ./src/H5config.h.in [REGENERATED] ./src/H5private.h ./src/H5.c ./test/h5test.c Added a wrapper for HDsnprintf() that just calls sprintf() if snprintf() isn't available. ./MANIFEST Added Paul's new h5toh4 files.
Diffstat (limited to 'src/H5.c')
-rw-r--r--src/H5.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5.c b/src/H5.c
index f97409d..09f3c85 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -438,6 +438,47 @@ H5close (void)
/*-------------------------------------------------------------------------
+ * Function: HDsnprintf
+ *
+ * Purpose: Writes output to the string BUF under control of the format
+ * FMT that specifies how subsequent arguments are converted for
+ * output. It is similar to sprintf except that SIZE specifies
+ * the maximum number of characters to produce. The trailing
+ * null character is counted towards this limit, so you should
+ * allocated at least SIZE characters for the string BUF.
+ *
+ * Note: This function is for compatibility on systems that don't have
+ * snprintf(3). It doesn't actually check for overflow like the
+ * real snprintf() would.
+ *
+ * Return: Success: Number of characters stored, not including
+ * the terminating null. If this value equals
+ * SIZE then there was not enough space in BUF
+ * for all the output.
+ *
+ * Failure: -1
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, November 24, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+HDsnprintf(char *buf, size_t __unused__ size, const char *fmt, ...)
+{
+ int n;
+ va_list ap;
+
+ va_start(ap, fmt);
+ n = vsprintf(buf, fmt, ap);
+ va_end(ap);
+ return n;
+}
+
+
+/*-------------------------------------------------------------------------
* Function: HDfprintf
*
* Purpose: Prints the optional arguments under the control of the format