Tobias Stoeckmann wrote:
> > > > > +     i = vsnprintf(str, len, fmt, ap);
> > > > >       va_end(ap);
> > > > >  
> > > > > -     if (i == -1 || i >= (int)size)
> > > > > -             fatal("xsnprintf: overflow");
> > > > > +     if (i < 0 || i >= (int)len)
> > > > > +             fatal("xsnprintf: could not allocate memory");
> > 
> > This change (among a few others) is wrong.
> 
> Could you give me a bit of detail what's wrong here?
> Can update the diff when you give me details on "a few others", too.

Anything that doesn't allocate memory can't fail to allocate memory. This
would be the sprintf variants that are not asprintf.

Reply via email to