]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix malformed if test. Regression of issue 15883.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 6 Apr 2010 18:08:32 +0000 (18:08 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 6 Apr 2010 18:08:32 +0000 (18:08 +0000)
Converted if statement to a switch statement for clarity.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@256365 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 295c041caf3bc9150077739dd2b5043ab900edc3..7c467c6696f731c25acb74581307cbea3747fe18 100644 (file)
@@ -9191,12 +9191,18 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
                ast_copy_string(tmp->context, conf->chan.context, sizeof(tmp->context));
                ast_copy_string(tmp->parkinglot, conf->chan.parkinglot, sizeof(tmp->parkinglot));
                tmp->cid_ton = 0;
-               if ((tmp->sig != SIG_PRI) || (tmp->sig != SIG_SS7) || (tmp->sig != SIG_BRI) || (tmp->sig != SIG_BRI_PTMP)) {
-                       ast_copy_string(tmp->cid_num, conf->chan.cid_num, sizeof(tmp->cid_num));
-                       ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name));
-               } else {
+               switch (tmp->sig) {
+               case SIG_PRI:
+               case SIG_BRI:
+               case SIG_BRI_PTMP:
+               case SIG_SS7:
                        tmp->cid_num[0] = '\0';
                        tmp->cid_name[0] = '\0';
+                       break;
+               default:
+                       ast_copy_string(tmp->cid_num, conf->chan.cid_num, sizeof(tmp->cid_num));
+                       ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name));
+                       break;
                }
                ast_copy_string(tmp->mailbox, conf->chan.mailbox, sizeof(tmp->mailbox));
                if (channel != CHAN_PSEUDO && !ast_strlen_zero(tmp->mailbox)) {