Add definition of nitems for those without it and use it throughout.

This commit is contained in:
Todd C. Miller
2016-06-23 10:58:07 -06:00
parent ff2cd3cf27
commit f683cbd582
9 changed files with 19 additions and 21 deletions

View File

@@ -59,7 +59,7 @@ static const char *const sudoers_subsystem_names[] = {
NULL
};
#define NUM_SUBSYSTEMS (sizeof(sudoers_subsystem_names) / sizeof(sudoers_subsystem_names[0]) - 1)
#define NUM_SUBSYSTEMS (nitems(sudoers_subsystem_names) - 1)
/* Subsystem IDs assigned at registration time. */
unsigned int sudoers_subsystem_ids[NUM_SUBSYSTEMS];