summaryrefslogtreecommitdiff
path: root/lib/kasprintf.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-05-31 23:26:08 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 00:49:27 (GMT)
commit725fe002d315c2501c110b7245d3eb4f4535f4d6 (patch)
treec68759e4765673eb1f28e220edea40d84d9ff744 /lib/kasprintf.c
parentd84970bbaf9a09b3fc60c18ee6d59bc9cb4c3b8a (diff)
downloadlinux-fsl-qoriq-725fe002d315c2501c110b7245d3eb4f4535f4d6.tar.xz
vsprintf: correctly handle width when '#' flag used in %#p format
The '%p' output of the kernel's vsprintf() uses spec.field_width to determine how many digits to output based on 2 * sizeof(void*) so that all digits of a pointer are shown. ie. a pointer will be output as "001A2B3C" instead of "1A2B3C". However, if the '#' flag is used in the format (%#p), then the code doesn't take into account the width of the '0x' prefix and will end up outputing "0x1A2B3C" instead of "0x001A2B3C". This patch reworks the "pointer()" format hook to include 2 characters for the '0x' prefix if the '#' flag is included. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/kasprintf.c')
0 files changed, 0 insertions, 0 deletions