libs/libc/stdio/lib_libvsprintf.c: Correct justification for alternate forms of %p and %P

This commit is contained in:
ligd 2019-01-27 06:22:01 -06:00 committed by Gregory Nutt
parent 818d8dda1e
commit d6740a6678

View File

@ -980,7 +980,8 @@ static void prejustify(FAR struct lib_outstream_s *obj, uint8_t fmt,
uint8_t justify, uint8_t flags, int fieldwidth,
int valwidth, int trunc)
{
bool althex = (fmt == 'x' || fmt == 'X') && IS_ALTFORM(flags);
bool althex = (fmt == 'x' || fmt == 'X' || fmt == 'p' || fmt == 'P')
&& IS_ALTFORM(flags);
int i;
/* If there is integer precision, then use FMT_RJUST vs FMT_RJUST0 */