diff options
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r-- | lib/vsprintf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index a9bda0a361f3..e4e9031dd9c3 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -269,6 +269,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
269 | int qualifier; /* 'h', 'l', or 'L' for integer fields */ | 269 | int qualifier; /* 'h', 'l', or 'L' for integer fields */ |
270 | /* 'z' support added 23/7/1999 S.H. */ | 270 | /* 'z' support added 23/7/1999 S.H. */ |
271 | /* 'z' changed to 'Z' --davidm 1/25/99 */ | 271 | /* 'z' changed to 'Z' --davidm 1/25/99 */ |
272 | /* 't' added for ptrdiff_t */ | ||
272 | 273 | ||
273 | /* Reject out-of-range values early */ | 274 | /* Reject out-of-range values early */ |
274 | if (unlikely((int) size < 0)) { | 275 | if (unlikely((int) size < 0)) { |
@@ -339,7 +340,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
339 | /* get the conversion qualifier */ | 340 | /* get the conversion qualifier */ |
340 | qualifier = -1; | 341 | qualifier = -1; |
341 | if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || | 342 | if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || |
342 | *fmt =='Z' || *fmt == 'z') { | 343 | *fmt =='Z' || *fmt == 'z' || *fmt == 't') { |
343 | qualifier = *fmt; | 344 | qualifier = *fmt; |
344 | ++fmt; | 345 | ++fmt; |
345 | if (qualifier == 'l' && *fmt == 'l') { | 346 | if (qualifier == 'l' && *fmt == 'l') { |
@@ -467,6 +468,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
467 | num = (signed long) num; | 468 | num = (signed long) num; |
468 | } else if (qualifier == 'Z' || qualifier == 'z') { | 469 | } else if (qualifier == 'Z' || qualifier == 'z') { |
469 | num = va_arg(args, size_t); | 470 | num = va_arg(args, size_t); |
471 | } else if (qualifier == 't') { | ||
472 | num = va_arg(args, ptrdiff_t); | ||
470 | } else if (qualifier == 'h') { | 473 | } else if (qualifier == 'h') { |
471 | num = (unsigned short) va_arg(args, int); | 474 | num = (unsigned short) va_arg(args, int); |
472 | if (flags & SIGN) | 475 | if (flags & SIGN) |