diff options
author | araujo <araujo@FreeBSD.org> | 2016-04-20 01:05:54 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2016-04-20 01:05:54 +0000 |
commit | d47eafbc02b0b771f8ef71e5aed545e393c5d82f (patch) | |
tree | 83b2eab8023cf0325b882d606c1767c73c6250dd /sbin/sunlabel | |
parent | b114a1a94bd718bed7b0d08eb2d2b2f19936a608 (diff) | |
download | FreeBSD-src-d47eafbc02b0b771f8ef71e5aed545e393c5d82f.zip FreeBSD-src-d47eafbc02b0b771f8ef71e5aed545e393c5d82f.tar.gz |
Use nitems() from sys/param.h.
MFC after: 2 weeks.
Diffstat (limited to 'sbin/sunlabel')
-rw-r--r-- | sbin/sunlabel/sunlabel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/sunlabel/sunlabel.c b/sbin/sunlabel/sunlabel.c index 7bf051e..092b1d3 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; |