lib_libvscanf.c: Implement "j" modifier for scanf

It's a part of C99 and commonly used these days.
This commit is contained in:
YAMAMOTO Takashi 2020-09-23 17:52:33 +09:00 committed by Xiang Xiao
parent a92e394884
commit 3e6561c3cf

View file

@ -332,6 +332,15 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
fmt++;
}
}
else if (fmt_char(fmt) == 'j')
{
/* Same as long long if available. Otherwise, long. */
#ifdef CONFIG_LIBC_LONG_LONG
modifier = LL_MOD;
#else
modifier = L_MOD;
#endif
}
else if (fmt_char(fmt) == 'h' || fmt_char(fmt) == 'H')
{
modifier = H_MOD;