[FFmpeg-cvslog] ftp: explicit return code checks
Lukasz Marek
git at videolan.org
Sat Jun 8 16:05:29 CEST 2013
ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki at gmail.com> | Mon Jun 3 01:39:01 2013 +0200| [bc29acdc76fdbf70700cdc2f85fc2afb46e19e47] | committer: Lukasz Marek
ftp: explicit return code checks
Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc29acdc76fdbf70700cdc2f85fc2afb46e19e47
---
libavformat/ftp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index f730c6d..b2e842f 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -386,7 +386,7 @@ static int ftp_store(FTPContext *s)
const int stor_codes[] = {150, 0};
snprintf(command, sizeof(command), "STOR %s\r\n", s->path);
- if (!ftp_send_command(s, command, stor_codes, NULL))
+ if (ftp_send_command(s, command, stor_codes, NULL) != 150)
return AVERROR(EIO);
s->state = UPLOADING;
@@ -443,7 +443,7 @@ static int ftp_connect_control_connection(URLContext *h)
}
/* consume all messages from server */
- if (!ftp_status(s, NULL, connect_codes)) {
+ if (ftp_status(s, NULL, connect_codes) != 220) {
av_log(h, AV_LOG_ERROR, "FTP server not ready for new users\n");
err = AVERROR(EACCES);
return err;
More information about the ffmpeg-cvslog
mailing list