Merge "res_fax: Remove checks for unsigned values being >= 0."

This commit is contained in:
Joshua Colp
2017-11-20 13:33:35 -06:00
committed by Gerrit Code Review

View File

@@ -4561,12 +4561,7 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat
unsigned int gwtimeout; unsigned int gwtimeout;
if (sscanf(timeout, "%30u", &gwtimeout) == 1) { if (sscanf(timeout, "%30u", &gwtimeout) == 1) {
if (gwtimeout >= 0) { details->gateway_timeout = gwtimeout * 1000;
details->gateway_timeout = gwtimeout * 1000;
} else {
ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative. Ignoring timeout\n",
cmd, data);
}
} else { } else {
ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data); 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 (details->faxdetect_id < 0) {
if (timeout) { if (timeout) {
if (sscanf(timeout, "%30u", &fdtimeout) == 1) { if (sscanf(timeout, "%30u", &fdtimeout) == 1) {
if (fdtimeout >= 0) { fdtimeout *= 1000;
fdtimeout *= 1000;
} else {
ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative. Ignoring timeout\n",
cmd, data);
fdtimeout = 0;
}
} else { } else {
ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n",
timeout, data); timeout, data);