Skip to content
Commit 39e874f8 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar
Browse files

vsprintf: fix bug in negative value printing

Sitsofe Wheeler found and bisected that while unifying the
vsprintf format decoding in:

  fef20d9c

: vsprintf: unify the format decoding layer for its 3 users

The sign flag has been dropped out in favour of
precise types (ie: LONG/ULONG).

But the format helper number() still needs this flag to keep track of
the signedness unless it will consider all numbers as unsigned.

Also add an explicit cast to int (for %d) while parsing with va_arg()
to ensure the highest bit is well extended on the 64 bits number that
hosts the value in case of negative values.

Reported-Bisected-Tested-by: default avatarSitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20090309201503.GA5010@nowhere>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent fef20d9c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment