From e0e9815b79abab30cf81e915ac0ee89c06c34a17 Mon Sep 17 00:00:00 2001 From: "Devchandra Leishangthem dlmeetei@gmail.com" Date: Fri, 12 Jun 2015 12:56:40 +0530 Subject: [PATCH] use ARRAY_SIZE instead of manual array size calculation --- http_parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/http_parser.c b/http_parser.c index cbe8a90b..29114466 100644 --- a/http_parser.c +++ b/http_parser.c @@ -2152,15 +2152,13 @@ http_parser_settings_init(http_parser_settings *settings) const char * http_errno_name(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].name; } const char * http_errno_description(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].description; }