[kvm-unit-tests PATCH v5 05/11] lib/printf: support the %u unsigned fmt field

Alex Bennée
2015-07-31T15:54:29Z

---
lib/printf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/lib/printf.c b/lib/printf.c
index 89308fb..5d83605 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -180,6 +180,19 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va)
break;
}
break;
+ case 'u':
+ switch (nlong) {
+ case 0:
+ print_unsigned(&s, va_arg(va, unsigned), 10, props);
+ break;
+ case 1:
+ print_unsigned(&s, va_arg(va, unsigned long), 10, props);
+ break;
+ default:
+ print_unsigned(&s, va_arg(va, unsigned long long), 10, props);
+ break;
+ }
+ break;
case 'x':
switch (nlong) {
case 0:
--
2.5.0