diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/speed_table.c | 2 | ||||
-rw-r--r-- | libbb/u_signal_names.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libbb/speed_table.c b/libbb/speed_table.c index 6137b77..0f0b33d 100644 --- a/libbb/speed_table.c +++ b/libbb/speed_table.c @@ -54,7 +54,7 @@ static const struct speed_map speeds[] = { #endif }; -enum { NUM_SPEEDS = (sizeof(speeds) / sizeof(struct speed_map)) }; +enum { NUM_SPEEDS = ARRAY_SIZE(speeds) }; unsigned int tty_baud_to_value(speed_t speed) { diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c index dc4c0b2..f8eaea7 100644 --- a/libbb/u_signal_names.c +++ b/libbb/u_signal_names.c @@ -127,7 +127,7 @@ int get_signum(const char *name) return i; if (strncasecmp(name, "SIG", 3) == 0) name += 3; - for (i = 0; i < sizeof(signals) / sizeof(signals[0]); i++) + for (i = 0; i < ARRAY_SIZE(signals); i++) if (strcasecmp(name, signals[i]) == 0) return i; @@ -152,7 +152,7 @@ int get_signum(const char *name) const char *get_signame(int number) { - if ((unsigned)number < sizeof(signals) / sizeof(signals[0])) { + if ((unsigned)number < ARRAY_SIZE(signals)) { if (signals[number][0]) /* if it's not an empty str */ return signals[number]; } |