From ab0b162ef63f919b7e436b07a794134570d792ab Mon Sep 17 00:00:00 2001 From: "dlmeetei@gmail.com" Date: Fri, 12 Jun 2015 12:56:40 +0530 Subject: [PATCH] src: use ARRAY_SIZE instead of sizeof() PR-URL: https://github.com/joyent/http-parser/pull/252 Reviewed-By: Fedor Indutny --- http_parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/http_parser.c b/http_parser.c index cbe8a90..2911446 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; }