summaryrefslogtreecommitdiff
path: root/libbb/u_signal_names.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-25 10:55:35 +0000
committerDenis Vlasenko2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /libbb/u_signal_names.c
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-80b8b39899a09c7516920cda5fd343b3086d4824.zip
busybox-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'libbb/u_signal_names.c')
-rw-r--r--libbb/u_signal_names.c4
1 files changed, 2 insertions, 2 deletions
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];
}