From: Richard Mudgett Date: Wed, 30 Jan 2013 21:59:07 +0000 (+0000) Subject: chan_dahdi: Fix "dahdi show channels group" for groups greater than 31. X-Git-Tag: 13.0.0-beta1~2140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6458a6572be60b5fa2fa80b521d3dfeef363caa7;p=thirdparty%2Fasterisk.git chan_dahdi: Fix "dahdi show channels group" for groups greater than 31. The variable type used was not large enough to hold a group bit field. ........ Merged revisions 380572 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 380575 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380576 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 84b308910b..e077e84226 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -15543,7 +15543,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 %-32.32s\n" #define FORMAT2 "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s %-32.32s\n" - int targetnum = 0; + ast_group_t targetnum = 0; int filtertype = 0; struct dahdi_pvt *tmp = NULL; char tmps[20] = ""; @@ -15570,9 +15570,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;