summaryrefslogtreecommitdiff
path: root/bsd-snprintf.c
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 /bsd-snprintf.c
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>
Diffstat (limited to 'bsd-snprintf.c')
-rw-r--r--bsd-snprintf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bsd-snprintf.c b/bsd-snprintf.c
index 3a82a586f..59fefbf25 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)
260 case 'd': 260 case 'd':
261 case 'i': 261 case 'i':
262 if (cflags == DP_C_SHORT) 262 if (cflags == DP_C_SHORT)
263 value = va_arg (args, short int); 263 value = va_arg (args, int);
264 else if (cflags == DP_C_LONG) 264 else if (cflags == DP_C_LONG)
265 value = va_arg (args, long int); 265 value = va_arg (args, long int);
266 else if (cflags == DP_C_LONG_LONG) 266 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)
272 case 'o': 272 case 'o':
273 flags |= DP_F_UNSIGNED; 273 flags |= DP_F_UNSIGNED;
274 if (cflags == DP_C_SHORT) 274 if (cflags == DP_C_SHORT)
275 value = va_arg (args, unsigned short int); 275 value = va_arg (args, unsigned int);
276 else if (cflags == DP_C_LONG) 276 else if (cflags == DP_C_LONG)
277 value = va_arg (args, unsigned long int); 277 value = va_arg (args, unsigned long int);
278 else if (cflags == DP_C_LONG_LONG) 278 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)
284 case 'u': 284 case 'u':
285 flags |= DP_F_UNSIGNED; 285 flags |= DP_F_UNSIGNED;
286 if (cflags == DP_C_SHORT) 286 if (cflags == DP_C_SHORT)
287 value = va_arg (args, unsigned short int); 287 value = va_arg (args, unsigned int);
288 else if (cflags == DP_C_LONG) 288 else if (cflags == DP_C_LONG)
289 value = va_arg (args, unsigned long int); 289 value = va_arg (args, unsigned long int);
290 else if (cflags == DP_C_LONG_LONG) 290 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)
298 case 'x': 298 case 'x':
299 flags |= DP_F_UNSIGNED; 299 flags |= DP_F_UNSIGNED;
300 if (cflags == DP_C_SHORT) 300 if (cflags == DP_C_SHORT)
301 value = va_arg (args, unsigned short int); 301 value = va_arg (args, unsigned int);
302 else if (cflags == DP_C_LONG) 302 else if (cflags == DP_C_LONG)
303 value = va_arg (args, unsigned long int); 303 value = va_arg (args, unsigned long int);
304 else if (cflags == DP_C_LONG_LONG) 304 else if (cflags == DP_C_LONG_LONG)