Re: [PATCH v5 02/21] lib/vsprintf: Print time and date in human readable format via %pt

From: Andy Shevchenko
Date: Tue Dec 04 2018 - 11:39:00 EST


On Tue, Dec 04, 2018 at 05:16:58PM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 4, 2018 at 5:12 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Tue, Dec 04, 2018 at 02:30:28PM +0100, Petr Mladek wrote:
> > > On Thu 2018-11-29 12:59:40, Andy Shevchenko wrote:
> > > > There are users which print time and date represented by content of
> > > > struct rtc_time in human readable format.
> > > >
> > > > Instead of open coding that each time introduce %ptR[dt][r] specifier.
> >
> > > > +static void __init
> > > > +struct_rtc_time(void)
> > > > +{
> > > > +}
> > >
> > > Just by chance, do you have any plans to add the test code? ;-)
> > >
> > > I understand that you did now want to spend time on it before
> > > the real change was accepted.
> >
> > You see, there were several iterations with no consensus on everything:
> > specifier format changed 3 times, for example.
> >
> > But it might be good idea to eventually add couple simple tests at some point.
> >
> > Is it a show stopper?
>
> Can the user trigger formatting, and exploit a bug in the formatting code?

Might happen, it's a software at the end.
Do we need to revisit all formatting specifiers right now?

In any case, to be productive out of this discussion, I would like to gather
test cases you want to see.

--
With Best Regards,
Andy Shevchenko