summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-11-16 18:09:38 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-11-16 18:09:38 (GMT)
commit7fbe30d5abcaf3218a7cea93137fe1f76566484a (patch)
tree3f37b922733208588aa27677824a4ab434bdbdf1 /src/H5private.h
parent671187fd2b53c916f444e849a2fd57bac06552f8 (diff)
downloadhdf5-7fbe30d5abcaf3218a7cea93137fe1f76566484a.zip
hdf5-7fbe30d5abcaf3218a7cea93137fe1f76566484a.tar.gz
hdf5-7fbe30d5abcaf3218a7cea93137fe1f76566484a.tar.bz2
[svn-r11735] Purpose:
Cleanup. Description: Removed the home-made version of snprintf and vsnprintf since they do not actually enforce the size parameter correctly and could corrupt memory or as a security hole. This block of code has been turned off since Aug 11, 2005 for all platforms except Tflops. No one has reported any problem since--sort of empirical evidence that all platforms except Tflops support both functions. Tflops has retired in September. So, no need to keep this block of code. Also, fixed the HDxxx macro to call the corresponding xxx function. Platforms tested: Tested in heping, both serial and parallel.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 21e2d43..b86a419 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -801,12 +801,10 @@ typedef off_t h5_stat_size_t;
#define HDsin(X) sin(X)
#define HDsinh(X) sinh(X)
#define HDsleep(N) sleep(N)
-#ifdef H5_HAVE_SNPRINTF
#ifdef WIN32
-#define HDsnprintf _snprintf /*varargs*/
+#define HDsnprintf _snprintf /*varargs*/
#else
-# define HDsnprintf snprintf /*varargs*/
-#endif
+#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
#define HDsqrt(X) sqrt(X)
@@ -887,13 +885,11 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A)
#define HDvprintf(FMT,A) vprintf(FMT,A)
#define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A)
-#ifdef H5_HAVE_VSNPRINTF
#ifdef WIN32
# define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A)
#else
# define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A)
#endif
-#endif
#define HDwait(W) wait(W)
#define HDwaitpid(P,W,O) waitpid(P,W,O)
#define HDwcstombs(S,P,Z) wcstombs(S,P,Z)
@@ -925,17 +921,6 @@ extern char *strdup(const char *s);
#endif /* WIN32 */
-/* Define our own HDsnprintf only for TFLOPS. */
-#ifdef __PUMAGON__
-#ifndef H5_HAVE_SNPRINTF
-H5_DLL int HDsnprintf(char *buf, size_t size, const char *fmt, ...);
-#endif
-
-#ifndef H5_HAVE_VSNPRINTF
-H5_DLL int HDvsnprintf(char *buf, size_t size, const char *fmt, va_list ap);
-#endif
-#endif
-
/*
* These macros check whether debugging has been requested for a certain
* package at run-time. Code for debugging is conditionally compiled by