libs/libc/sscanf: Support pointer format

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2024-07-16 20:26:08 +08:00 committed by Xiang Xiao
parent 9320638848
commit ae6a7a4526

View File

@ -292,9 +292,9 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
linfo("Processing %c\n", fmt_char(fmt));
#ifdef CONFIG_LIBC_SCANSET
if (strchr("dibouxXcseEfFgGaAn[%", fmt_char(fmt)))
if (strchr("diboupxXcseEfFgGaAn[%", fmt_char(fmt)))
#else
if (strchr("dibouxXcseEfFgGaAn%", fmt_char(fmt)))
if (strchr("diboupxXcseEfFgGaAn%", fmt_char(fmt)))
#endif
{
if (fmt_char(fmt) != '%')
@ -561,9 +561,9 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
}
}
/* Process %d, %o, %b, %x, %u: Various integer conversions */
/* Process %d, %o, %b, %p, %x, %u: Various integer conversions */
else if (strchr("dobxXui", fmt_char(fmt)))
else if (strchr("dobpxXui", fmt_char(fmt)))
{
bool sign;
@ -682,6 +682,7 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
base = 10;
break;
case 'p':
case 'x':
case 'X':
while (fwidth < width && !stopconv)