>>> On 18.02.15 at 16:39, <boris.ostrov...@oracle.com> wrote: > --- a/xen/common/vsprintf.c > +++ b/xen/common/vsprintf.c > @@ -269,7 +269,28 @@ static char *pointer(char *str, char *end, const char > **fmt_ptr, > { > const char *fmt = *fmt_ptr, *s; > > - /* Custom %p suffixes. See XEN_ROOT/docs/misc/printk-formats.txt */ > + /* > + * For custom %p suffixes (see XEN_ROOT/docs/misc/printk-formats.txt) > + * if arg pointer is bogus then print pointer value in parentheses. > + */ > + if ( (unsigned long)arg < HYPERVISOR_VIRT_START ) > + { > + switch (fmt[1]) > + { > + case 'h': > + case 's': > + case 'S': > + case 'v': > + ++*fmt_ptr; > + if ( str < end ) > + *str++ = '('; > + str = number(str, end, (unsigned long)arg, 16, -1, -1, ZEROPAD); > + if ( str < end ) > + *str++ = ')';
You should take existing code as reference when adding to it: Both increments above need to happen unconditionally. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel