]> The Tcpdump Group git mirrors - tcpdump/commitdiff
As GCC "2.96" notes, "`short int' is promoted to `int' when passed
authorguy <guy>
Tue, 2 Jan 2001 22:33:04 +0000 (22:33 +0000)
committerguy <guy>
Tue, 2 Jan 2001 22:33:04 +0000 (22:33 +0000)
through `...'", and therefore "...you should pass `int' not `short int'
to `va_arg'".

GCC "2.96" apparently fails to compile code that passes "short int" to
"va_arg()", and Red Hat Linux 7.0 uses GCC "2.96", so we fix this, as
per Pekka Savola's note.

missing/snprintf.c

index 9683ecaf8fa268af491d83dff364f14275f4f317..bada4721344cd35a8197ff544b38f44efb1c49d2 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-/* $Id: snprintf.c,v 1.3 2000-01-10 16:57:44 fenner Exp $ */
+/* $Id: snprintf.c,v 1.4 2001-01-02 22:33:04 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.3 2000-01-10 16:57:44 fenner Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.4 2001-01-02 22:33:04 guy Exp $";
 #endif
 
 #include <stdio.h>
@@ -274,7 +274,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)