Skip to content
Snippets Groups Projects
Commit f354b73e authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD Committed by Wolfgang Denk
Browse files

vsprintf: add z and t options

parent 25dbe98a
No related branches found
No related tags found
No related merge requests found
...@@ -262,7 +262,9 @@ int vsprintf(char *buf, const char *fmt, va_list args) ...@@ -262,7 +262,9 @@ int vsprintf(char *buf, const char *fmt, va_list args)
/* get the conversion qualifier */ /* get the conversion qualifier */
qualifier = -1; 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; qualifier = *fmt;
if (qualifier == 'l' && *(fmt+1) == 'l') { if (qualifier == 'l' && *(fmt+1) == 'l') {
qualifier = 'q'; qualifier = 'q';
...@@ -355,9 +357,13 @@ int vsprintf(char *buf, const char *fmt, va_list args) ...@@ -355,9 +357,13 @@ int vsprintf(char *buf, const char *fmt, va_list args)
num = va_arg(args, unsigned long long); num = va_arg(args, unsigned long long);
else else
#endif #endif
if (qualifier == 'l') if (qualifier == 'l') {
num = va_arg(args, unsigned long); 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); num = (unsigned short) va_arg(args, int);
if (flags & SIGN) if (flags & SIGN)
num = (short) num; num = (short) num;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment