use standard ARRAY_SIZE() macro

Replace all the custom `sizeof(array)/sizeof(element)` and
`sizeof(array)/sizeof(type)` with the standard macro ARRAY_SIZE().
This commit is contained in:
Eric Engestrom 2018-07-30 14:29:34 +01:00
parent 5f8676f214
commit 021933f735
14 changed files with 33 additions and 23 deletions

View file

@ -783,7 +783,7 @@ static char *get_config_path(void) {
wordexp_t p;
char *path;
for (size_t i = 0; i < sizeof(config_paths) / sizeof(char *); ++i) {
for (size_t i = 0; i < ARRAY_SIZE(config_paths); ++i) {
if (wordexp(config_paths[i], &p, 0) == 0) {
path = strdup(p.we_wordv[0]);
wordfree(&p);