mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user