aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3833476bf..37769827c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2429,7 +2429,7 @@ static unsigned int parse_sip_options(struct sip_pvt *pvt, const char *supported
next = ast_skip_blanks(next);
if (sipdebug)
ast_debug(3, "Found SIP option: -%s-\n", next);
- for (i=0; i < (sizeof(sip_options) / sizeof(sip_options[0])); i++) {
+ for (i = 0; i < ARRAY_LEN(sip_options); i++) {
if (!strcasecmp(next, sip_options[i].text)) {
profile |= sip_options[i].id;
found = TRUE;
@@ -5526,9 +5526,10 @@ static const char *find_alias(const char *name, const char *_default)
};
int x;
- for (x=0; x<sizeof(aliases) / sizeof(aliases[0]); x++)
+ for (x = 0; x < ARRAY_LEN(aliases); x++) {
if (!strcasecmp(aliases[x].fullname, name))
return aliases[x].shortname;
+ }
return _default;
}
@@ -12693,7 +12694,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
ast_cli(fd, " SIP Options : ");
if (peer->sipoptions) {
int lastoption = -1;
- for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+ for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
if (sip_options[x].id != lastoption) {
if (peer->sipoptions & sip_options[x].id)
ast_cli(fd, "%s ", sip_options[x].text);
@@ -13518,7 +13519,7 @@ static char *sip_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_a
ast_cli(a->fd, " SIP Options: ");
if (cur->sipoptions) {
int x;
- for (x=0 ; (x < (sizeof(sip_options) / sizeof(sip_options[0]))); x++) {
+ for (x = 0 ; x < ARRAY_LEN(sip_options); x++) {
if (cur->sipoptions & sip_options[x].id)
ast_cli(a->fd, "%s ", sip_options[x].text);
}