]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_dahdi: Fix "dahdi show channels group" for groups greater than 31.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 30 Jan 2013 21:41:43 +0000 (21:41 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 30 Jan 2013 21:41:43 +0000 (21:41 +0000)
The variable type used was not large enough to hold a group bit field.

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

channels/chan_dahdi.c

index a95a8ce3ac1da34f5541a1aefa4a97bb283141de..bdd52e23112535d40f94fd331b1cd101f13db522 100644 (file)
@@ -15237,7 +15237,7 @@ static char *dahdi_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
 {
 #define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
 #define FORMAT2 "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
-       unsigned int targetnum = 0;
+       ast_group_t targetnum = 0;
        int filtertype = 0;
        struct dahdi_pvt *tmp = NULL;
        char tmps[20] = "";
@@ -15264,9 +15264,10 @@ static char *dahdi_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
        if (a->argc == 5) {
                if (!strcasecmp(a->argv[3], "group")) {
                        targetnum = atoi(a->argv[4]);
-                       if ((targetnum < 0) || (targetnum > 63))
+                       if (63 < targetnum) {
                                return CLI_SHOWUSAGE;
-                       targetnum = 1 << targetnum;
+                       }
+                       targetnum = ((ast_group_t) 1) << targetnum;
                        filtertype = 1;
                } else if (!strcasecmp(a->argv[3], "context")) {
                        filtertype = 2;