From 5a899fc50333525cb4c2dfe83aff3955472b8d0e Mon Sep 17 00:00:00 2001
From: Corey Farrell <git@cfware.com>
Date: Sat, 18 Nov 2017 21:02:17 -0500
Subject: [PATCH] res_fax: Remove checks for unsigned values being >= 0.

It's impossible for gwtimeout or fdtimeout to be less than 0 because
they are unsigned int's.  Remove checks and unreachable branches.

Change-Id: Ib2286960621e6ee245e40013c84986143302bc78
---
 res/res_fax.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/res/res_fax.c b/res/res_fax.c
index b25b6d16d4..4a1c0846f2 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -4561,12 +4561,7 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
 					unsigned int gwtimeout;
 
 					if (sscanf(timeout, "%30u", &gwtimeout) == 1) {
-						if (gwtimeout >= 0) {
-							details->gateway_timeout = gwtimeout * 1000;
-						} else {
-							ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative.  Ignoring timeout\n",
-								cmd, data);
-						}
+						details->gateway_timeout = gwtimeout * 1000;
 					} else {
 						ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data);
 					}
@@ -4605,13 +4600,7 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
 			if (details->faxdetect_id < 0) {
 				if (timeout) {
 					if (sscanf(timeout, "%30u", &fdtimeout) == 1) {
-						if (fdtimeout >= 0) {
-							fdtimeout *= 1000;
-						} else {
-							ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative.  Ignoring timeout\n",
-								cmd, data);
-							fdtimeout = 0;
-						}
+						fdtimeout *= 1000;
 					} else {
 						ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n",
 							timeout, data);
-- 
GitLab