Re: [PATCH] perf: Incorrect use of snprintf results in SEGV

Arnaldo Carvalho de Melo
2012-03-08T00:58:42Z

Em Wed, Mar 07, 2012 at 03:19:51PM -0600, Peter Seebach escreveu:
> On Wed, 7 Mar 2012 21:37:25 +0100 Ingo Molnar <mingo@elte.hu> wrote:
> > We *DONT* want to make APIs more fragile just to accomodate a
> > rare, esoteric usecase!
>
> I would view snprintf as an API which already exists. If it's the
> wrong API, by all means, write a different one -- but I would suggest
> not using the same name for it. If a function is going to be called
> snprintf, IMO it should have the semantics of snprintf. If those are
> the wrong semantics (and they may well be), then I would say use a
> function which has the right semantics, and isn't named snprintf.

Right, its more a case of: Don't assume people do things you think are
reasonable, read carefully and follow the instructions.

At least it is not as long as other EULAs, it is much, much shorter,
but managed to be just as non intuitive.

- Arnaldo