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

Commit

Permalink
src: use ARRAY_SIZE instead of sizeof()
Browse files Browse the repository at this point in the history
PR-URL: #252
Reviewed-By: Fedor Indutny <[email protected]>
  • Loading branch information
deleisha authored and indutny committed Jul 4, 2015
1 parent 39ff097 commit ab0b162
Showing 1 changed file with 2 additions and 4 deletions.
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

0 comments on commit ab0b162

Please sign in to comment.