[FFmpeg-devel] [PATCH] Make cmdutils.c:print_error() use strerror() if av_strerror() fails (e.g. if strerror_r() is not defined)

Stefano Sabatini stefano.sabatini-lala
Wed May 5 00:32:15 CEST 2010


On date Tuesday 2010-05-04 17:12:24 +0200, Michael Niedermayer encoded:
> On Tue, May 04, 2010 at 03:41:46PM +0200, Stefano Sabatini wrote:
[...]
> >  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);
> >      }
> 
> you need to document the -1 case as well

Documentation clarified.

Regards.
-- 
FFmpeg = Fiendish Fascinating Martial Powerful Erudite Game



More information about the ffmpeg-devel mailing list