Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

use ARRAY_SIZE instead of manual array size calculation #252

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down