src: use ARRAY_SIZE instead of sizeof()

PR-URL: https://github.com/joyent/http-parser/pull/252
Reviewed-By: Fedor Indutny <fedor@indutny.com>
make-http-max-header-size-gyp-configurable
dlmeetei@gmail.com 10 years ago committed by Fedor Indutny
parent 39ff0975c2
commit ab0b162ef6

@ -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;
}

Loading…
Cancel
Save