aboutsummaryrefslogtreecommitdiffstats
path: root/main/manager.c
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-08 16:41:31 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-08 16:41:31 +0000
commit3b5c2f2ec9a1f1b932a72c54ec99f2ade7b874e5 (patch)
tree2e4756c8d1b95bdec564a84466c61973aa5e336e /main/manager.c
parentb2d0a411d289307a4a22e2647d0ad5540542de01 (diff)
Merged revisions 129045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r129045 | bbryant | 2008-07-08 11:40:28 -0500 (Tue, 08 Jul 2008) | 7 lines Janitor project to convert sizeof to ARRAY_LEN macro. (closes issue #13002) Reported by: caio1982 Patches: janitor_arraylen5.diff uploaded by caio1982 (license 22) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@129046 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/manager.c b/main/manager.c
index d655c5907..3b580005c 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -344,7 +344,7 @@ static char *authority_to_str(int authority, struct ast_str **res)
char *sep = "";
(*res)->used = 0;
- for (i = 0; i < (sizeof(perms) / sizeof(perms[0])) - 1; i++) {
+ for (i = 0; i < ARRAY_LEN(perms) - 1; i++) {
if (authority & perms[i].num) {
ast_str_append(res, 0, "%s%s", sep, perms[i].label);
sep = ",";
@@ -386,7 +386,7 @@ static int get_perm(const char *instr)
if (!instr)
return 0;
- for (x = 0; x < (sizeof(perms) / sizeof(perms[0])); x++) {
+ for (x = 0; x < ARRAY_LEN(perms); x++) {
if (ast_instring(instr, perms[x].label, ','))
ret |= perms[x].num;
}
@@ -414,7 +414,7 @@ static int strings_to_mask(const char *string)
return 0;
if (ast_true(string)) { /* all permissions */
int x, ret = 0;
- for (x = 0; x<sizeof(perms) / sizeof(perms[0]); x++)
+ for (x = 0; x < ARRAY_LEN(perms); x++)
ret |= perms[x].num;
return ret;
}