Make groups be 64-bits (bug #3351, with mods)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-01-15 21:51:38 +00:00
parent a0e6229adb
commit 96503a02c1
11 changed files with 65 additions and 64 deletions

27
utils.c
View File

@@ -430,30 +430,3 @@ char *ast_strcasestr(const char *haystack, const char *needle)
}
}
#endif
/*--- ast_print_group: Print call group and pickup group ---*/
char *ast_print_group(char *buf, int buflen, unsigned int group)
{
unsigned int i;
int first=1;
char num[3];
buf[0] = '\0';
if (!group) /* Return empty string if no group */
return(buf);
for (i=0; i<=31; i++) { /* Max group is 31 */
if (group & (1 << i)) {
if (!first) {
strncat(buf, ", ", buflen);
} else {
first=0;
}
snprintf(num, sizeof(num), "%u", i);
strncat(buf, num, buflen);
}
}
return(buf);
}