Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140503
b: refs/heads/master
c: 39e874f
h: refs/heads/master
i:
  140501: d1017ad
  140499: 4b48032
  140495: bcaeadf
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Mar 10, 2009
1 parent 17c2c2d commit 3463168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: fef20d9c1380f04ba9492d6463148db07b413708
refs/heads/master: 39e874f8afbdb3745e2406ce4ecbde9ac4cbaa78
13 changes: 6 additions & 7 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,6 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
static int format_decode(const char *fmt, struct printf_spec *spec)
{
const char *start = fmt;
bool sign = false;

/* we finished early by reading the field width */
if (spec->type == FORMAT_TYPE_WITDH) {
Expand Down Expand Up @@ -900,7 +899,7 @@ static int format_decode(const char *fmt, struct printf_spec *spec)

case 'd':
case 'i':
sign = true;
spec->flags |= SIGN;
case 'u':
break;

Expand All @@ -912,7 +911,7 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
if (spec->qualifier == 'L')
spec->type = FORMAT_TYPE_LONG_LONG;
else if (spec->qualifier == 'l') {
if (sign)
if (spec->flags & SIGN)
spec->type = FORMAT_TYPE_LONG;
else
spec->type = FORMAT_TYPE_ULONG;
Expand All @@ -921,12 +920,12 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
} else if (spec->qualifier == 't') {
spec->type = FORMAT_TYPE_PTRDIFF;
} else if (spec->qualifier == 'h') {
if (sign)
if (spec->flags & SIGN)
spec->type = FORMAT_TYPE_SHORT;
else
spec->type = FORMAT_TYPE_USHORT;
} else {
if (sign)
if (spec->flags & SIGN)
spec->type = FORMAT_TYPE_INT;
else
spec->type = FORMAT_TYPE_UINT;
Expand Down Expand Up @@ -1101,8 +1100,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case FORMAT_TYPE_SHORT:
num = (short) va_arg(args, int);
break;
case FORMAT_TYPE_UINT:
num = va_arg(args, unsigned int);
case FORMAT_TYPE_INT:
num = (int) va_arg(args, int);
break;
default:
num = va_arg(args, unsigned int);
Expand Down

0 comments on commit 3463168

Please sign in to comment.