From 5b7933fe5e47ad0bc333b405f554c20f8cc2efed Mon Sep 17 00:00:00 2001 From: Brett Bryant Date: Fri, 11 Jul 2008 18:09:35 +0000 Subject: Janitor patch to change uses of sizeof to ARRAY_LEN (closes issue #13054) Reported by: pabelanger Patches: ARRAY_LEN.patch2 uploaded by pabelanger (license 224) Tested by: seanbright git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130129 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'channels/chan_sip.c') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0d2743ca9..245d75717 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2601,7 +2601,7 @@ static int find_sip_method(const char *msg) if (ast_strlen_zero(msg)) return 0; - for (i = 1; i < (sizeof(sip_methods) / sizeof(sip_methods[0])) && !res; i++) { + for (i = 1; i < (ARRAY_LEN(sip_methods)) && !res; i++) { if (method_match(i, msg)) res = sip_methods[i].id; } @@ -13640,7 +13640,7 @@ static const char *subscription_type2str(enum subscriptiontype subtype) { int i; - for (i = 1; (i < (sizeof(subscription_types) / sizeof(subscription_types[0]))); i++) { + for (i = 1; i < ARRAY_LEN(subscription_types); i++) { if (subscription_types[i].type == subtype) { return subscription_types[i].text; } @@ -13653,7 +13653,7 @@ static const struct cfsubscription_types *find_subscription_type(enum subscripti { int i; - for (i = 1; (i < (sizeof(subscription_types) / sizeof(subscription_types[0]))); i++) { + for (i = 1; i < ARRAY_LEN(subscription_types); i++) { if (subscription_types[i].type == subtype) { return &subscription_types[i]; } -- cgit v1.2.3