[PATCH 1/3] Make av_strerror() return -1 even in the case when av_strerror_r() is not defined.
Stefano Sabatini
stefano.sabatini-lala
Mon May 3 23:28:01 CEST 2010
This allows applications to check if av_strerror() cannot provide a
meaningful representation for the provided error code, without to
actually check the filled string.
---
libavutil/error.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/libavutil/error.c b/libavutil/error.c
index 3dd38a3..b6d6019 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);
}
--
1.7.0
--mP3DRpeJDSE+ciuQ
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-Make-print_error-use-strerror-in-case-av_strerror-fa.patch"
More information about the ffmpeg-devel
mailing list