Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176367
b: refs/heads/master
c: 08562cb
h: refs/heads/master
i:
  176365: 564b187
  176363: 4f3e4f5
  176359: 7585647
  176351: 07c28ed
v: v3
  • Loading branch information
André Goddard Rosa authored and Linus Torvalds committed Dec 15, 2009
1 parent 8cbb51a commit f3304b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b9186f5eb0b1705abf7b2fbf33076a6b83f9d89
refs/heads/master: 08562cb27da6a1472be15898173105b46801a73b
15 changes: 7 additions & 8 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
qualifier:
/* get the conversion qualifier */
spec->qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
*fmt == 'Z' || *fmt == 'z' || *fmt == 't') {
if (*fmt == 'h' || TOLOWER(*fmt) == 'l' ||
TOLOWER(*fmt) == 'z' || *fmt == 't') {
spec->qualifier = *fmt++;
if (unlikely(spec->qualifier == *fmt)) {
if (spec->qualifier == 'l') {
Expand Down Expand Up @@ -1102,7 +1102,7 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
spec->type = FORMAT_TYPE_LONG;
else
spec->type = FORMAT_TYPE_ULONG;
} else if (spec->qualifier == 'Z' || spec->qualifier == 'z') {
} else if (TOLOWER(spec->qualifier) == 'z') {
spec->type = FORMAT_TYPE_SIZE_T;
} else if (spec->qualifier == 't') {
spec->type = FORMAT_TYPE_PTRDIFF;
Expand Down Expand Up @@ -1249,8 +1249,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
if (qualifier == 'l') {
long *ip = va_arg(args, long *);
*ip = (str - buf);
} else if (qualifier == 'Z' ||
qualifier == 'z') {
} else if (TOLOWER(qualifier) == 'z') {
size_t *ip = va_arg(args, size_t *);
*ip = (str - buf);
} else {
Expand Down Expand Up @@ -1540,7 +1539,7 @@ do { \
void *skip_arg;
if (qualifier == 'l')
skip_arg = va_arg(args, long *);
else if (qualifier == 'Z' || qualifier == 'z')
else if (TOLOWER(qualifier) == 'z')
skip_arg = va_arg(args, size_t *);
else
skip_arg = va_arg(args, int *);
Expand Down Expand Up @@ -1851,8 +1850,8 @@ int vsscanf(const char *buf, const char *fmt, va_list args)

/* get conversion qualifier */
qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
*fmt == 'Z' || *fmt == 'z') {
if (*fmt == 'h' || TOLOWER(*fmt) == 'l' ||
TOLOWER(*fmt) == 'z') {
qualifier = *fmt++;
if (unlikely(qualifier == *fmt)) {
if (qualifier == 'h') {
Expand Down

0 comments on commit f3304b5

Please sign in to comment.