David Schultz <[EMAIL PROTECTED]> writes:
> Maxim Konovalov <[EMAIL PROTECTED]> writes:
> > err(1, "asprintf") was my first version, yes.  But I failed to find in
> > the man page it sets errno.  Thanks for the review, I'll fix the typo
> > shortly.
> I don't think it always does set errno, but you can set errno to 0
> before the call, and you'll get either the real error message from
> err() or "unknown error".

If asprintf() fails because malloc() failed, malloc() will have set
errno to ENOMEM.  I can't think of any other failure mode for asprintf()
that won't either be silently ignored (error in format string) or result
in a segmentation fault (bogus argument to %s).

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to