]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib-vsprintf-optimize-put_dec_trunc8-fix
authorGeorge Spelvin <linux@horizon.com>
Fri, 28 Sep 2012 00:20:13 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:01:19 +0000 (14:01 +1000)
commit7292e8c052c86255911c986261fad3fb145f715a
tree3b83ca59c30c19bf6132cd76f1c942d301776b3e
parentf94ef8d524c8d721b5a54be664d047b6bc22a36a
lib-vsprintf-optimize-put_dec_trunc8-fix

Rabin Vincent <rabin@rab.in> wrote:
> This patch breaks IP address printing with "%pI4" (and by extension,
> nfsroot).  Example:
>
>  - Before: 10.0.0.1
>  - After: 10...1

Mea culpa, and thank you for catching it!  As I said in my earlier
comment, I tested this most extensively wrapped by some sprintf code
that liked 0 converted to a 0-length string, as that works naturally
with the ANSI spec for %.0u.  And it turns out not to matter for the
usual printf code, as num_to_str special-cases that anyway.

The fix is straightforward:

Signed-off-by: George Spelvin <linux@horizon.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/vsprintf.c