mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 13:18:50 +08:00
libs/libc/sscanf: Support pointer format
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
9320638848
commit
ae6a7a4526
1 changed files with 5 additions and 4 deletions
|
@ -292,9 +292,9 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||||
linfo("Processing %c\n", fmt_char(fmt));
|
linfo("Processing %c\n", fmt_char(fmt));
|
||||||
|
|
||||||
#ifdef CONFIG_LIBC_SCANSET
|
#ifdef CONFIG_LIBC_SCANSET
|
||||||
if (strchr("dibouxXcseEfFgGaAn[%", fmt_char(fmt)))
|
if (strchr("diboupxXcseEfFgGaAn[%", fmt_char(fmt)))
|
||||||
#else
|
#else
|
||||||
if (strchr("dibouxXcseEfFgGaAn%", fmt_char(fmt)))
|
if (strchr("diboupxXcseEfFgGaAn%", fmt_char(fmt)))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (fmt_char(fmt) != '%')
|
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;
|
bool sign;
|
||||||
|
|
||||||
|
@ -682,6 +682,7 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||||
base = 10;
|
base = 10;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'p':
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'X':
|
case 'X':
|
||||||
while (fwidth < width && !stopconv)
|
while (fwidth < width && !stopconv)
|
||||||
|
|
Loading…
Reference in a new issue