Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217548
b: refs/heads/master
c: 5e05798
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Oct 26, 2010
1 parent 50b4b17 commit e9d4d55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 77006a0a828249dd69341f960043ee41e7487aa0
refs/heads/master: 5e0579812834ab7fa072db4a15ebdff68d62e2e7
11 changes: 9 additions & 2 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,15 @@ static noinline_for_stack
char *pointer(const char *fmt, char *buf, char *end, void *ptr,
struct printf_spec spec)
{
if (!ptr)
if (!ptr) {
/*
* Print (null) with the same width as a pointer so it makes
* tabular output look nice.
*/
if (spec.field_width == -1)
spec.field_width = 2 * sizeof(void *);
return string(buf, end, "(null)", spec);
}

switch (*fmt) {
case 'F':
Expand Down Expand Up @@ -1031,7 +1038,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
}
spec.flags |= SMALL;
if (spec.field_width == -1) {
spec.field_width = 2*sizeof(void *);
spec.field_width = 2 * sizeof(void *);
spec.flags |= ZEROPAD;
}
spec.base = 16;
Expand Down

0 comments on commit e9d4d55

Please sign in to comment.