diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 00:55:22 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 00:55:22 -0400 |
commit | 617e44fdfd7ee3d53388ab295d9411b826437ce9 (patch) | |
tree | ed6bd2a5960f706fa93c6df2cbfb75ede926fd1c /lib | |
parent | 4887f76ec3d38e99286c9d0fdd6a719174d02e44 (diff) | |
parent | 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'lib')
-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 a9bda0a361f..e4e9031dd9c 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) int qualifier; /* 'h', 'l', or 'L' for integer fields */ /* 'z' support added 23/7/1999 S.H. */ /* 'z' changed to 'Z' --davidm 1/25/99 */ + /* 't' added for ptrdiff_t */ /* Reject out-of-range values early */ if (unlikely((int) size < 0)) { @@ -339,7 +340,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) /* get the conversion qualifier */ qualifier = -1; if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || - *fmt =='Z' || *fmt == 'z') { + *fmt =='Z' || *fmt == 'z' || *fmt == 't') { qualifier = *fmt; ++fmt; if (qualifier == 'l' && *fmt == 'l') { @@ -467,6 +468,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) num = (signed long) num; } else if (qualifier == 'Z' || qualifier == 'z') { num = va_arg(args, size_t); + } else if (qualifier == 't') { + num = va_arg(args, ptrdiff_t); } else if (qualifier == 'h') { num = (unsigned short) va_arg(args, int); if (flags & SIGN) |