Skip to content
Snippets Groups Projects
Commit 527dbe39 authored by Russell Bryant's avatar Russell Bryant
Browse files

Simplify the if statements used to check to see if the argument was "num"

or "number".  It is not possible to ever reach the second part of this
conditional statement.

Thanks to my brother, Brett, for pointing this out.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent d3bf06f2
No related branches found
No related tags found
No related merge requests found
......@@ -54,9 +54,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
snprintf(buf, len, "\"%s\" <%s>", name, num);
} else if (!strncasecmp("name", data, 4)) {
ast_copy_string(buf, name, len);
} else if (!strncasecmp("num", data, 3) ||
!strncasecmp("number", data, 6)) {
} else if (!strncasecmp("num", data, 3)) {
ast_copy_string(buf, num, len);
} else {
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
......@@ -70,8 +68,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
if (chan->cid.cid_name) {
ast_copy_string(buf, chan->cid.cid_name, len);
}
} else if (!strncasecmp("num", data, 3)
|| !strncasecmp("number", data, 6)) {
} else if (!strncasecmp("num", data, 3)) {
if (chan->cid.cid_num) {
ast_copy_string(buf, chan->cid.cid_num, len);
}
......@@ -113,8 +110,7 @@ static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
ast_set_callerid(chan, num, name, num);
} else if (!strncasecmp("name", data, 4)) {
ast_set_callerid(chan, NULL, value, NULL);
} else if (!strncasecmp("num", data, 3) ||
!strncasecmp("number", data, 6)) {
} else if (!strncasecmp("num", data, 3)) {
ast_set_callerid(chan, value, NULL, NULL);
} else if (!strncasecmp("ani", data, 3)) {
ast_set_callerid(chan, NULL, NULL, value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment