diff mbox series

[FFmpeg-devel,2/6] avformat/ftp: check return value of av_bprint_finalize()

Message ID 1592839474-2804-2-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/6] avutil/opt: check return value of av_bprint_finalize()
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Limin Wang June 22, 2020, 3:24 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/ftp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marton Balint June 22, 2020, 9:08 p.m. UTC | #1
On Mon, 22 Jun 2020, lance.lmwang@gmail.com wrote:

> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> libavformat/ftp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> index caeea42..39ea297 100644
> --- a/libavformat/ftp.c
> +++ b/libavformat/ftp.c
> @@ -200,7 +200,7 @@ static int ftp_status(FTPContext *s, char **line, const int response_codes[])
>     }
>
>     if (line)
> -        av_bprint_finalize(&line_buffer, line);
> +        result = av_bprint_finalize(&line_buffer, line);

No. ftp_status is not a function which returns 0 on success, it returns 
the FTP status code. Please be more careful before submitting patches.

Regards,
Marton
Limin Wang June 22, 2020, 11:06 p.m. UTC | #2
On Mon, Jun 22, 2020 at 11:08:23PM +0200, Marton Balint wrote:
> 
> 
> On Mon, 22 Jun 2020, lance.lmwang@gmail.com wrote:
> 
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> > libavformat/ftp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/ftp.c b/libavformat/ftp.c
> > index caeea42..39ea297 100644
> > --- a/libavformat/ftp.c
> > +++ b/libavformat/ftp.c
> > @@ -200,7 +200,7 @@ static int ftp_status(FTPContext *s, char **line, const int response_codes[])
> >     }
> > 
> >     if (line)
> > -        av_bprint_finalize(&line_buffer, line);
> > +        result = av_bprint_finalize(&line_buffer, line);
> 
> No. ftp_status is not a function which returns 0 on success, it returns the
> FTP status code. Please be more careful before submitting patches.

Sorry, please ignore the patch. I'm not clear how to map the error so I'll not
update the patch anyore.

> 
> Regards,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index caeea42..39ea297 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -200,7 +200,7 @@  static int ftp_status(FTPContext *s, char **line, const int response_codes[])
     }
 
     if (line)
-        av_bprint_finalize(&line_buffer, line);
+        result = av_bprint_finalize(&line_buffer, line);
     return result;
 }