1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Cast va_arg(..., int) to short if a short value is expected.

Published in <sxsbshgxfs5.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-12-03 11:31:17 -08:00
parent f58c338aea
commit 79f868cd0f
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-12-03 Hrvoje Niksic <hniksic@arsdigita.com>
* snprintf.c (dopr): Cast the result of va_arg to short int and
short unsigned int where these types are expected to be used.
2001-12-03 Hrvoje Niksic <hniksic@arsdigita.com> 2001-12-03 Hrvoje Niksic <hniksic@arsdigita.com>
* snprintf.c (dopr): Replace `short int' and `unsigned short int' * snprintf.c (dopr): Replace `short int' and `unsigned short int'

View File

@ -309,7 +309,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'd': case 'd':
case 'i': case 'i':
if (cflags == DP_C_SHORT) if (cflags == DP_C_SHORT)
value = va_arg (args, int); value = (short int)va_arg (args, int);
else if (cflags == DP_C_LONG) else if (cflags == DP_C_LONG)
value = va_arg (args, long int); value = va_arg (args, long int);
else if (cflags == DP_C_LLONG) else if (cflags == DP_C_LLONG)
@ -321,7 +321,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'o': case 'o':
flags |= DP_F_UNSIGNED; flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT) if (cflags == DP_C_SHORT)
value = va_arg (args, int); value = (short int)va_arg (args, int);
else if (cflags == DP_C_LONG) else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int); value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LLONG) else if (cflags == DP_C_LLONG)
@ -333,7 +333,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'u': case 'u':
flags |= DP_F_UNSIGNED; flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT) if (cflags == DP_C_SHORT)
value = va_arg (args, int); value = (unsigned short int)va_arg (args, int);
else if (cflags == DP_C_LONG) else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int); value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LLONG) else if (cflags == DP_C_LLONG)
@ -347,7 +347,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'x': case 'x':
flags |= DP_F_UNSIGNED; flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT) if (cflags == DP_C_SHORT)
value = va_arg (args, int); value = (short int)va_arg (args, int);
else if (cflags == DP_C_LONG) else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int); value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LLONG) else if (cflags == DP_C_LLONG)