summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-11-11 09:03:32 +1100
committerDamien Miller <djm@mindrot.org>2000-11-11 09:03:32 +1100
commit9f4f7552ee994634cc79a6f90ae4e9347f536cec (patch)
tree8323e9e1da25a5267527103c579c682bb24c81fd
parent29abb1b6a91dbda9bd7f6b9d4ae8ff4164d2f2d1 (diff)
- (djm) Fix vsprintf("%h") in bsd-snprintf.c, short int va_args are
promoted to type int. Report and fix from Dan Astoorian <djast@cs.toronto.edu>
-rw-r--r--ChangeLog3
-rw-r--r--bsd-snprintf.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d25eebb..07abae0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
- (djm) Added /etc/primes for kex DH group neg, fixup Makefile.in and
packaging files
- (djm) Fix new Makefile.in warnings
+ - (djm) Fix vsprintf("%h") in bsd-snprintf.c, short int va_args are
+ promoted to type int. Report and fix from Dan Astoorian
+ <djast@cs.toronto.edu>
20001110
- (bal) Fixed dropped answer from skey_keyinfo() in auth1.c
diff --git a/bsd-snprintf.c b/bsd-snprintf.c
index 3a82a586..59fefbf2 100644
--- a/bsd-snprintf.c
+++ b/bsd-snprintf.c
@@ -260,7 +260,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'd':
case 'i':
if (cflags == DP_C_SHORT)
- value = va_arg (args, short int);
+ value = va_arg (args, int);
else if (cflags == DP_C_LONG)
value = va_arg (args, long int);
else if (cflags == DP_C_LONG_LONG)
@@ -272,7 +272,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'o':
flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned short int);
+ value = va_arg (args, unsigned int);
else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LONG_LONG)
@@ -284,7 +284,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'u':
flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned short int);
+ value = va_arg (args, unsigned int);
else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LONG_LONG)
@@ -298,7 +298,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 'x':
flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT)
- value = va_arg (args, unsigned short int);
+ value = va_arg (args, unsigned int);
else if (cflags == DP_C_LONG)
value = va_arg (args, unsigned long int);
else if (cflags == DP_C_LONG_LONG)