From: Corey Farrell Date: Sun, 19 Nov 2017 02:02:17 +0000 (-0500) Subject: res_fax: Remove checks for unsigned values being >= 0. X-Git-Tag: 13.19.0-rc1~111^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f270cbe9e977424bb3a5d03ce3b5fe412f5aea3;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_fax.c b/res/res_fax.c index 666c2d997d..6e4451b679 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -4563,12 +4563,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); } @@ -4607,13 +4602,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);