aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-03-03 22:42:26 -0800
committerRob Landley <rob@landley.net>2019-03-04 07:30:47 -0600
commit6d1eb1ce40801323b65401a70ae5f9782939eeb4 (patch)
treed94f6577702a8b626c3a4d4e1d1991868681cdda /lib
parent9be2e85165c3b93c87f63209c3597559333b1fc3 (diff)
downloadtoybox-6d1eb1ce40801323b65401a70ae5f9782939eeb4.tar.gz
Consistently use ARRAY_LEN.
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 76d5765c..54bfc8c4 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -907,7 +907,7 @@ int sig_to_num(char *pidstr)
if (!strncasecmp(pidstr, "sig", 3)) pidstr+=3;
}
- for (i = 0; i < sizeof(signames)/sizeof(struct signame); i++)
+ for (i=0; i<ARRAY_LEN(signames); i++)
if (!pidstr) xputs(signames[i].name);
else if (!strcasecmp(pidstr, signames[i].name)) return signames[i].num;
@@ -918,7 +918,7 @@ char *num_to_sig(int sig)
{
int i;
- for (i=0; i<sizeof(signames)/sizeof(struct signame); i++)
+ for (i=0; i<ARRAY_LEN(signames); i++)
if (signames[i].num == sig) return signames[i].name;
return NULL;
}