aboutsummaryrefslogtreecommitdiff
path: root/sbin/sunlabel
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2016-04-20 01:05:54 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2016-04-20 01:05:54 +0000
commitfb4e4bd7f93133aa06a38b3fec97b1e163daed79 (patch)
tree83b2eab8023cf0325b882d606c1767c73c6250dd /sbin/sunlabel
parent8d340432aa5ca4bd03804c85454279647ac6b50c (diff)
downloadsrc-fb4e4bd7f93133aa06a38b3fec97b1e163daed79.tar.gz
src-fb4e4bd7f93133aa06a38b3fec97b1e163daed79.zip
Use nitems() from sys/param.h.
MFC after: 2 weeks.
Notes
Notes: svn path=/head/; revision=298320
Diffstat (limited to 'sbin/sunlabel')
-rw-r--r--sbin/sunlabel/sunlabel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/sunlabel/sunlabel.c b/sbin/sunlabel/sunlabel.c
index 7bf051ef4786..092b1d321989 100644
--- a/sbin/sunlabel/sunlabel.c
+++ b/sbin/sunlabel/sunlabel.c
@@ -903,7 +903,7 @@ tagname(unsigned int tag)
struct tags *tp;
for (i = 0, tp = knowntags;
- i < sizeof(knowntags) / sizeof(struct tags);
+ i < nitems(knowntags);
i++, tp++)
if (tp->id == tag)
return (tp->name);
@@ -921,7 +921,7 @@ flagname(unsigned int flag)
struct tags *tp;
for (i = 0, tp = knownflags;
- i < sizeof(knownflags) / sizeof(struct tags);
+ i < nitems(knownflags);
i++, tp++)
if (tp->id == flag)
return (tp->name);
@@ -940,7 +940,7 @@ parse_tag(struct sun_disklabel *sl, int part, const char *tag)
unsigned long l;
for (i = 0, tp = knowntags;
- i < sizeof(knowntags) / sizeof(struct tags);
+ i < nitems(knowntags);
i++, tp++)
if (strcmp(tp->name, tag) == 0) {
sl->sl_vtoc_map[part].svtoc_tag = (uint16_t)tp->id;
@@ -965,7 +965,7 @@ parse_flag(struct sun_disklabel *sl, int part, const char *flag)
unsigned long l;
for (i = 0, tp = knownflags;
- i < sizeof(knownflags) / sizeof(struct tags);
+ i < nitems(knownflags);
i++, tp++)
if (strcmp(tp->name, flag) == 0) {
sl->sl_vtoc_map[part].svtoc_flag = (uint16_t)tp->id;