diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-07-14 14:11:45 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-07-14 14:36:52 +0200 |
commit | f354b73e16a86f9e9085471a830605f74f84ea5d (patch) | |
tree | 2eb18e29cc31b6f46d5857795d1814ef3a2d6cc4 /lib_generic | |
parent | 25dbe98abb686d8210e1731fba85ced7d3ce874c (diff) | |
download | u-boot-f354b73e16a86f9e9085471a830605f74f84ea5d.tar.gz u-boot-f354b73e16a86f9e9085471a830605f74f84ea5d.tar.bz2 u-boot-f354b73e16a86f9e9085471a830605f74f84ea5d.zip |
vsprintf: add z and t options
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'lib_generic')
-rw-r--r-- | lib_generic/vsprintf.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib_generic/vsprintf.c b/lib_generic/vsprintf.c index 3db6c3f936..7c9cfe16ce 100644 --- a/lib_generic/vsprintf.c +++ b/lib_generic/vsprintf.c @@ -262,7 +262,9 @@ int vsprintf(char *buf, const char *fmt, va_list args) /* get the conversion qualifier */ qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'q') { + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || + *fmt == 'Z' || *fmt == 'z' || *fmt == 't' || + *fmt == 'q' ) { qualifier = *fmt; if (qualifier == 'l' && *(fmt+1) == 'l') { qualifier = 'q'; @@ -355,9 +357,13 @@ int vsprintf(char *buf, const char *fmt, va_list args) num = va_arg(args, unsigned long long); else #endif - if (qualifier == 'l') + if (qualifier == 'l') { num = va_arg(args, unsigned long); - else if (qualifier == 'h') { + } 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) num = (short) num; |