From 527dbe399e230fa8f9384c38e509567dab77d2f7 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 25 Dec 2006 02:31:04 +0000 Subject: [PATCH] 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 --- funcs/func_callerid.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c index 5af8e1ca15..6621d4d7cc 100644 --- a/funcs/func_callerid.c +++ b/funcs/func_callerid.c @@ -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); -- 2.47.2