]> The Tcpdump Group git mirrors - tcpdump/blobdiff - missing/snprintf.c
Include "config.h" before including anything else.
[tcpdump] / missing / snprintf.c
index 49c70e61093d8fd9c4742979895e6a59c07b7b8f..2b8368838f163f55889ce0ffb2df75d3b6f26c47 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: snprintf.c,v 1.2 2000-01-09 21:35:46 fenner Exp $ */
+/* $Id: snprintf.c,v 1.5 2001-01-12 10:14:40 guy Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -39,7 +39,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.2 2000-01-09 21:35:46 fenner Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.5 2001-01-12 10:14:40 guy Exp $";
 #endif
 
 #include <stdio.h>
@@ -47,6 +47,7 @@ static const char rcsid[] =
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <sys/types.h>
 
 #include <interface.h>
 
@@ -92,6 +93,7 @@ sn_append_char (struct state *state, unsigned char c)
 }
 #endif
 
+#if 0
 static int
 as_reserve (struct state *state, size_t n)
 {
@@ -125,6 +127,7 @@ as_append_char (struct state *state, unsigned char c)
     return 0;
   }
 }
+#endif
 
 static int
 append_number(struct state *state,
@@ -273,7 +276,7 @@ append_char(struct state *state,
 if (long_flag) \
      res = (unsig long)va_arg(arg, unsig long); \
 else if (short_flag) \
-     res = (unsig short)va_arg(arg, unsig short); \
+     res = (unsig short)va_arg(arg, unsig int); \
 else \
      res = (unsig int)va_arg(arg, unsig int)
 
@@ -489,6 +492,7 @@ snprintf (char *str, size_t sz, const char *format, ...)
 }
 #endif
 
+#if 0
 #ifndef HAVE_ASPRINTF
 int
 asprintf (char **ret, const char *format, ...)
@@ -599,6 +603,7 @@ vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
   }
 }
 #endif
+#endif
 
 #ifndef HAVE_VSNPRINTF
 int