ref: 12b9daba425a3cd0584930390d6a7e105b63cd29
parent: aebade976e2e351524c119a1f54435fd4b66cb20
author: cbagwell <cbagwell>
date: Tue Nov 6 16:54:08 EST 2001
Fixing u_int32_t typo and backing out use of vsnprintf since not supported on all platforms
--- a/src/st.h
+++ b/src/st.h
@@ -26,7 +26,7 @@
#include <sys/types.h>
#endif
#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
+#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
@@ -74,7 +74,7 @@
/* FIXME: Remove from usage by libst */
#define LONG int32_t
-#define ULONG u_int32_t
+#define ULONG uint32_t
/* FIXME: Get rid of this and usage of LONG_MAX */
#define MAXLONG 0x7fffffffL
--- a/src/util.c
+++ b/src/util.c
@@ -78,9 +78,8 @@
/* Warning: no error checking is done with errstr. Be sure not to
- * go over the array limit ourself!
- * Note: Changing vsprintf to vsnprintf should help that but bad
- * references to strings can still cause overflow.
+ * go over the array limit ourself! vsnprint does not seem to be
+ * on all platforms so not using that.
*/
void st_fail_errno(ft_t ft, int st_errno, const char *fmt, ...)
{
@@ -89,7 +88,7 @@
ft->st_errno = st_errno;
va_start(args, fmt);
- vsnprintf(ft->st_errstr, 255,fmt, args);
+ vsprintf(ft->st_errstr, fmt, args);
va_end(args);
ft->st_errstr[255] = '\0';
}