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

Commit ab0b162

Browse files
deleishaindutny
authored andcommitted
src: use ARRAY_SIZE instead of sizeof()
PR-URL: #252 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 39ff097 commit ab0b162

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

http_parser.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,15 +2152,13 @@ http_parser_settings_init(http_parser_settings *settings)
21522152

21532153
const char *
21542154
http_errno_name(enum http_errno err) {
2155-
assert(((size_t) err) <
2156-
(sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0])));
2155+
assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab));
21572156
return http_strerror_tab[err].name;
21582157
}
21592158

21602159
const char *
21612160
http_errno_description(enum http_errno err) {
2162-
assert(((size_t) err) <
2163-
(sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0])));
2161+
assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab));
21642162
return http_strerror_tab[err].description;
21652163
}
21662164

0 commit comments

Comments
 (0)