From: Matthew Jordan Date: Sun, 29 Apr 2012 19:43:53 +0000 (+0000) Subject: Fix error that caused truncate operations to fail X-Git-Tag: 10.5.0-rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76b379c1c8a275555541b715aa36ad61e5428143;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 ........ Merged revisions 364578 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@364579 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/formats/format_g719.c b/formats/format_g719.c index 0a0eea1703..ee9221230d 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 b3e87367e3..c3c194d152 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 477883f179..f11fa97d96 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 26306806c2..47ed41c3ad 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 1e820bf212..bf7d167fd1 100644 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -154,7 +154,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 25ba54a77c..3f8c42ed1b 100644 --- a/formats/format_h264.c +++ b/formats/format_h264.c @@ -147,7 +147,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 e18c78ab1b..07155b717d 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 f65a6202f8..b763b55925 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 f3e53e7955..77a9fe3efb 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 a07144bfc0..35e2a34600 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 9820544594..30a1ebe316 100644 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -114,7 +114,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_vox.c b/formats/format_vox.c index 3f3b1eabb3..f640021d8b 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 ca12ca47b7..4e2418646e 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 e4c5051a29..f08e9ce21e 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; }