mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 06:32:44 +00:00
pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
parent
67db7b43d0
commit
f93475cf0f
@ -388,7 +388,7 @@ filemode(void)
|
||||
printf(sizeof(uintptr_t) == 4 ? fhdr32 : fhdr64);
|
||||
wid = (int)sizeof(uintptr_t) * 2;
|
||||
for (fp = (struct xfile *)buf, i = 0; i < openf; ++fp, ++i) {
|
||||
if ((size_t)fp->xf_type >= sizeof(dtypes) / sizeof(dtypes[0]))
|
||||
if ((size_t)fp->xf_type >= nitems(dtypes))
|
||||
continue;
|
||||
(void)printf("%*jx", wid, (uintmax_t)(uintptr_t)fp->xf_file);
|
||||
(void)printf(" %-6.6s", dtypes[fp->xf_type]);
|
||||
|
Loading…
Reference in New Issue
Block a user