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 --- utils/astman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/astman.c') diff --git a/utils/astman.c b/utils/astman.c index f674105a5..6c8d74291 100644 --- a/utils/astman.c +++ b/utils/astman.c @@ -258,14 +258,14 @@ static int process_message(struct ast_mansession *s, struct message *m) fprintf(stderr, "Missing event in request"); return 0; } - for (x=0;x= sizeof(events) / sizeof(events[0])) + if (x >= ARRAY_LEN(events)) fprintf(stderr, "Ignoring unknown event '%s'", event); #if 0 for (x=0;xhdrcount;x++) { -- cgit v1.2.3