From: Matthew Jordan Date: Sun, 29 Apr 2012 19:31:55 +0000 (+0000) Subject: Fix error that caused truncate operations to fail X-Git-Tag: 1.8.13.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f248f6eb71e56e9d0f89937bc64357022d760d7e;p=thirdparty%2Fasterisk.git Fix error that caused truncate operations to fail Another very inappropriate placement of a ')' (again introduced in r362151) caused the various truncate operations to attempt to truncate the sound file at a position of '0'. (issue ASTERISK-19655) Reported by: Matt Jordan (issue ASTERISK-19810) Reported by: colbec git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@364578 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/formats/format_g719.c b/formats/format_g719.c index 81662d521a..29cfa367f1 100644 --- a/formats/format_g719.c +++ b/formats/format_g719.c @@ -122,7 +122,7 @@ static int g719trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for g719 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in g719 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_g723.c b/formats/format_g723.c index 4d1c2cd56f..520f6aea49 100644 --- a/formats/format_g723.c +++ b/formats/format_g723.c @@ -125,7 +125,7 @@ static int g723_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for g723 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in g723 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_g729.c b/formats/format_g729.c index 5863ccec83..d0f0b4771f 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -120,7 +120,7 @@ static int g729_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for g729 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in g729 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_gsm.c b/formats/format_gsm.c index a8b70e56e7..5e534901e6 100644 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -160,7 +160,7 @@ static int gsm_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for gsm filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in gsm filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_h263.c b/formats/format_h263.c index 757437c8a6..8167b5effa 100644 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -156,7 +156,7 @@ static int h263_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for h263 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in h263 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_h264.c b/formats/format_h264.c index 84e94aa7a5..ab22f4779a 100644 --- a/formats/format_h264.c +++ b/formats/format_h264.c @@ -145,7 +145,7 @@ static int h264_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for h264 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in h264 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c index b7673d8ef0..8f5aad0e1a 100644 --- a/formats/format_ilbc.c +++ b/formats/format_ilbc.c @@ -118,7 +118,7 @@ static int ilbc_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for iLBC filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in iLBC filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_pcm.c b/formats/format_pcm.c index 4ff42f9626..49807f8d1c 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -168,7 +168,7 @@ static int pcm_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for pcm filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in pcm filestream %p: %s\n", fs, strerror(errno)); return -1; } @@ -445,7 +445,7 @@ static int au_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for au filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in au filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_siren14.c b/formats/format_siren14.c index e6cb3ec071..4a65146cb6 100644 --- a/formats/format_siren14.c +++ b/formats/format_siren14.c @@ -122,7 +122,7 @@ static int siren14trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for siren14 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in siren14 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_siren7.c b/formats/format_siren7.c index 1f361e1da2..b6646c3da4 100644 --- a/formats/format_siren7.c +++ b/formats/format_siren7.c @@ -122,7 +122,7 @@ static int siren7trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for siren7 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in siren7 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_sln.c b/formats/format_sln.c index 2a318f8655..fc74f00e38 100644 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -118,7 +118,7 @@ static int slinear_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for sln filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in sln filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_sln16.c b/formats/format_sln16.c index 1836fa5a26..782f5564e8 100644 --- a/formats/format_sln16.c +++ b/formats/format_sln16.c @@ -122,7 +122,7 @@ static int slinear_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for sln16 filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in sln16 filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_vox.c b/formats/format_vox.c index 3fd2504cb2..457c3c65ed 100644 --- a/formats/format_vox.c +++ b/formats/format_vox.c @@ -120,7 +120,7 @@ static int vox_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for vox filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in vox filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_wav.c b/formats/format_wav.c index f78ade4600..4453955d66 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -496,7 +496,7 @@ static int wav_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for wav filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in wav filestream %p: %s\n", fs, strerror(errno)); return -1; } diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index 4b13110d53..cf7e05644a 100644 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -530,7 +530,7 @@ static int wav_trunc(struct ast_filestream *fs) ast_log(AST_LOG_WARNING, "Unable to determine file descriptor for WAV filestream %p: %s\n", fs, strerror(errno)); return -1; } - if ((cur = ftello(fs->f) < 0)) { + if ((cur = ftello(fs->f)) < 0) { ast_log(AST_LOG_WARNING, "Unable to determine current position in WAV filestream %p: %s\n", fs, strerror(errno)); return -1; }