aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/vsprintf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 2e1dda2b549d..cba2385a6f0b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1034,8 +1034,8 @@ precision:
1034qualifier: 1034qualifier:
1035 /* get the conversion qualifier */ 1035 /* get the conversion qualifier */
1036 spec->qualifier = -1; 1036 spec->qualifier = -1;
1037 if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || 1037 if (*fmt == 'h' || TOLOWER(*fmt) == 'l' ||
1038 *fmt == 'Z' || *fmt == 'z' || *fmt == 't') { 1038 TOLOWER(*fmt) == 'z' || *fmt == 't') {
1039 spec->qualifier = *fmt++; 1039 spec->qualifier = *fmt++;
1040 if (unlikely(spec->qualifier == *fmt)) { 1040 if (unlikely(spec->qualifier == *fmt)) {
1041 if (spec->qualifier == 'l') { 1041 if (spec->qualifier == 'l') {
@@ -1102,7 +1102,7 @@ qualifier:
1102 spec->type = FORMAT_TYPE_LONG; 1102 spec->type = FORMAT_TYPE_LONG;
1103 else 1103 else
1104 spec->type = FORMAT_TYPE_ULONG; 1104 spec->type = FORMAT_TYPE_ULONG;
1105 } else if (spec->qualifier == 'Z' || spec->qualifier == 'z') { 1105 } else if (TOLOWER(spec->qualifier) == 'z') {
1106 spec->type = FORMAT_TYPE_SIZE_T; 1106 spec->type = FORMAT_TYPE_SIZE_T;
1107 } else if (spec->qualifier == 't') { 1107 } else if (spec->qualifier == 't') {
1108 spec->type = FORMAT_TYPE_PTRDIFF; 1108 spec->type = FORMAT_TYPE_PTRDIFF;
@@ -1249,8 +1249,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
1249 if (qualifier == 'l') { 1249 if (qualifier == 'l') {
1250 long *ip = va_arg(args, long *); 1250 long *ip = va_arg(args, long *);
1251 *ip = (str - buf); 1251 *ip = (str - buf);
1252 } else if (qualifier == 'Z' || 1252 } else if (TOLOWER(qualifier) == 'z') {
1253 qualifier == 'z') {
1254 size_t *ip = va_arg(args, size_t *); 1253 size_t *ip = va_arg(args, size_t *);
1255 *ip = (str - buf); 1254 *ip = (str - buf);
1256 } else { 1255 } else {
@@ -1540,7 +1539,7 @@ do { \
1540 void *skip_arg; 1539 void *skip_arg;
1541 if (qualifier == 'l') 1540 if (qualifier == 'l')
1542 skip_arg = va_arg(args, long *); 1541 skip_arg = va_arg(args, long *);
1543 else if (qualifier == 'Z' || qualifier == 'z') 1542 else if (TOLOWER(qualifier) == 'z')
1544 skip_arg = va_arg(args, size_t *); 1543 skip_arg = va_arg(args, size_t *);
1545 else 1544 else
1546 skip_arg = va_arg(args, int *); 1545 skip_arg = va_arg(args, int *);
@@ -1851,8 +1850,8 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
1851 1850
1852 /* get conversion qualifier */ 1851 /* get conversion qualifier */
1853 qualifier = -1; 1852 qualifier = -1;
1854 if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || 1853 if (*fmt == 'h' || TOLOWER(*fmt) == 'l' ||
1855 *fmt == 'Z' || *fmt == 'z') { 1854 TOLOWER(*fmt) == 'z') {
1856 qualifier = *fmt++; 1855 qualifier = *fmt++;
1857 if (unlikely(qualifier == *fmt)) { 1856 if (unlikely(qualifier == *fmt)) {
1858 if (qualifier == 'h') { 1857 if (qualifier == 'h') {