Re: [PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-11 Thread Petr Mladek
On Thu 2021-02-11 13:55:26, Petr Mladek wrote: > On Mon 2021-02-08 17:38:29, Richard Fitzgerald wrote: > > On 08/02/2021 15:18, Andy Shevchenko wrote: > > > On Mon, Feb 08, 2021 at 02:01:52PM +, Richard Fitzgerald wrote: > > > A nit-pick: What if we rewrite above as > > > > > > static

Re: [PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-11 Thread Petr Mladek
On Mon 2021-02-08 17:38:29, Richard Fitzgerald wrote: > On 08/02/2021 15:18, Andy Shevchenko wrote: > > On Mon, Feb 08, 2021 at 02:01:52PM +, Richard Fitzgerald wrote: > > > The existing code attempted to handle numbers by doing a strto[u]l(), > > > ignoring the field width, and then

Re: [PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-08 Thread Richard Fitzgerald
On 08/02/2021 15:18, Andy Shevchenko wrote: On Mon, Feb 08, 2021 at 02:01:52PM +, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract the field out of the full converted value. If

Re: [PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-08 Thread Andy Shevchenko
On Mon, Feb 08, 2021 at 02:01:52PM +, Richard Fitzgerald wrote: > The existing code attempted to handle numbers by doing a strto[u]l(), > ignoring the field width, and then repeatedly dividing to extract the > field out of the full converted value. If the string contains a run of > valid