Re: [PATCH v2 1/3] Introduce die_errno() that appends strerror(errno) to die()
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jun 6, 2009, 20:56 UTC
- Message-ID
- <200906062256.34074.trast@student.ethz.ch>
- In-Reply-To
- <200906062236.42858.j6t@kdbg.org>
Johannes Sixt wrote:
Show 12 quoted lines
> On Samstag, 6. Juni 2009, Thomas Rast wrote:
> > +void die_errno(const char *err, ...)
> > +{
> > + va_list params;
> > + char msg[1024];
> > +
> > + va_start(params, err);
> > +
> > + vsnprintf(msg, sizeof(msg), err, params);
> > + die("%s: %s", msg, strerror(errno));
>
> Cannot vsnprintf potentially modify errno?Manpage turns up nothing, so AFAICT, no.
> > + > > + va_end(params); > > This va_end should better be before die().
Not that I object to changing it, but out of curiosity, what do I break by putting it after?
--
Thomas Rast
trast@{inf,student}.ethz.ch