Mercurial > libavutil.hg
diff error.c @ 916:2860cc0b5562 libavutil
Make av_strerror() return -1 even in the case when av_strerror_r() is
not defined.
This allows applications to check if av_strerror() cannot provide a
meaningful representation for the provided error code, without having
to actually check the filled string.
author | stefano |
---|---|
date | Wed, 05 May 2010 21:44:47 +0000 |
parents | a1a27468a9c5 |
children |
line wrap: on
line diff
--- a/error.c Mon May 03 21:56:21 2010 +0000 +++ b/error.c Wed May 05 21:44:47 2010 +0000 @@ -36,8 +36,10 @@ } else { #if HAVE_STRERROR_R ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size); +#else + ret = -1; #endif - if (!HAVE_STRERROR_R || ret < 0) + if (ret < 0) snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum); }