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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user