From 60d9ca687cae3506d6c4f25982ff803acd3fb879 Mon Sep 17 00:00:00 2001
From: Matthew Jordan <mjordan@digium.com>
Date: Sun, 29 Apr 2012 19:50:57 +0000
Subject: [PATCH] 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
........

Merged revisions 364579 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 formats/format_g719.c    | 2 +-
 formats/format_g723.c    | 2 +-
 formats/format_g729.c    | 2 +-
 formats/format_gsm.c     | 2 +-
 formats/format_h263.c    | 2 +-
 formats/format_h264.c    | 2 +-
 formats/format_ilbc.c    | 2 +-
 formats/format_pcm.c     | 4 ++--
 formats/format_siren14.c | 2 +-
 formats/format_siren7.c  | 2 +-
 formats/format_sln.c     | 2 +-
 formats/format_vox.c     | 2 +-
 formats/format_wav.c     | 2 +-
 formats/format_wav_gsm.c | 2 +-
 14 files changed, 15 insertions(+), 15 deletions(-)

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 ec08867d8b..56e9b3aa0e 100644
--- a/formats/format_h263.c
+++ b/formats/format_h263.c
@@ -153,7 +153,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 e12601045e..e090c2bacd 100644
--- a/formats/format_h264.c
+++ b/formats/format_h264.c
@@ -146,7 +146,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;
 	}
-- 
GitLab