summaryrefslogtreecommitdiffstats
path: root/libavutil/error.c
diff options
context:
space:
mode:
authorReinhard Tartler <[email protected]>2010-05-19 08:03:22 +0000
committerReinhard Tartler <[email protected]>2010-05-19 08:03:22 +0000
commit1673bf86d6390cb3f7aaaae115264afa1dc41a14 (patch)
treeef02439ede9f0b29e3154850e6f8712fe617f99b /libavutil/error.c
parent0db6f6cfedaea5e1cbda35239023c06c5648ff3c (diff)
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. backport r23031 by stefano Originally committed as revision 23174 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavutil/error.c')
-rw-r--r--libavutil/error.c4
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);
}