public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH 0/1] vsprintf: add z and t options
@ 2008-07-14 12:11 Jean-Christophe PLAGNIOL-VILLARD
  2008-07-14 12:11 ` [U-Boot-Users] [PATCH 1/1] Fix some more printf() format issues Jean-Christophe PLAGNIOL-VILLARD
  2008-07-14 12:37 ` [U-Boot-Users] [PATCH 0/1] vsprintf: add z and t options Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-07-14 12:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 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 3db6c3f..1d9b25b 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;
-- 
1.5.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-14 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-14 12:11 [U-Boot-Users] [PATCH 0/1] vsprintf: add z and t options Jean-Christophe PLAGNIOL-VILLARD
2008-07-14 12:11 ` [U-Boot-Users] [PATCH 1/1] Fix some more printf() format issues Jean-Christophe PLAGNIOL-VILLARD
2008-07-14 20:59   ` Wolfgang Denk
2008-07-14 12:37 ` [U-Boot-Users] [PATCH 0/1] vsprintf: add z and t options Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox