[Asterisk-code-review] res fax: Remove checks for unsigned values being >= 0. (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Mon Nov 20 13:33:35 CST 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7282 )
Change subject: res_fax: Remove checks for unsigned values being >= 0.
......................................................................
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
---
M res/res_fax.c
1 file changed, 2 insertions(+), 13 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/res_fax.c b/res/res_fax.c
index b25b6d1..4a1c084 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -4561,12 +4561,7 @@
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 @@
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);
--
To view, visit https://gerrit.asterisk.org/7282
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2286960621e6ee245e40013c84986143302bc78
Gerrit-Change-Number: 7282
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171120/36cc63b5/attachment.html>
More information about the asterisk-code-review
mailing list