Skip to content

Commit

Permalink
vsprintf: fix io/mem resource width
Browse files Browse the repository at this point in the history
The leading "0x" consumes field width, so leave space for it in addition to
the 4 or 8 hex digits.  This means we'll print "0x0000-0x01df" rather than
"0x00-0x1df", for example.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Nov 4, 2009
1 parent 3368dd2 commit 2840537
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,11 @@ static char *resource_string(char *buf, char *end, struct resource *res,
struct printf_spec spec)
{
#ifndef IO_RSRC_PRINTK_SIZE
#define IO_RSRC_PRINTK_SIZE 4
#define IO_RSRC_PRINTK_SIZE 6
#endif

#ifndef MEM_RSRC_PRINTK_SIZE
#define MEM_RSRC_PRINTK_SIZE 8
#define MEM_RSRC_PRINTK_SIZE 10
#endif
struct printf_spec num_spec = {
.base = 16,
Expand Down

0 comments on commit 2840537

Please sign in to comment.