diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-05-05 21:44:47 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-05-05 21:44:47 +0000 |
commit | e2959f455850143272f3455a936dfd4d89ae9e03 (patch) | |
tree | ebff2c1911ab2411ada7300f9a01dc18e9903d03 /libavutil/error.c | |
parent | e9d96831f73f95d4b2cd69dd20dae95558b3be99 (diff) | |
download | ffmpeg-e2959f455850143272f3455a936dfd4d89ae9e03.tar.gz |
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.
Originally committed as revision 23031 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/error.c')
-rw-r--r-- | libavutil/error.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/error.c b/libavutil/error.c index 3dd38a351c..b6d6019061 100644 --- a/libavutil/error.c +++ b/libavutil/error.c @@ -36,8 +36,10 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size) } 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); } |