aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/locale
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-04-17 22:42:48 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-04-17 22:42:48 +0000
commit206541f2310c85fb99130e3446055ae2d0230d76 (patch)
tree0220e76e3d0d0b468ab4070fb84c62144b60b11b /usr.bin/locale
parentd9f0ce31900a48d1a2bfc1c8c86f79d1e831451a (diff)
downloadsrc-206541f2310c85fb99130e3446055ae2d0230d76.tar.gz
src-206541f2310c85fb99130e3446055ae2d0230d76.zip
Use the nitems() macro
Notes
Notes: svn path=/head/; revision=298169
Diffstat (limited to 'usr.bin/locale')
-rw-r--r--usr.bin/locale/locale.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/locale/locale.c b/usr.bin/locale/locale.c
index e0fe7be8460d..8e1b03a6db63 100644
--- a/usr.bin/locale/locale.c
+++ b/usr.bin/locale/locale.c
@@ -35,7 +35,9 @@
* nl_langinfo(CODESET).
*/
+#include <sys/param.h>
#include <sys/types.h>
+
#include <dirent.h>
#include <err.h>
#include <locale.h>
@@ -79,7 +81,7 @@ struct _lcinfo {
{ "LC_MONETARY", LC_MONETARY },
{ "LC_MESSAGES", LC_MESSAGES }
};
-#define NLCINFO (sizeof(lcinfo)/sizeof(lcinfo[0]))
+#define NLCINFO nitems(lcinfo)
/* ids for values not referenced by nl_langinfo() */
#define KW_ZERO 10000
@@ -290,7 +292,7 @@ main(int argc, char *argv[])
}
} else {
uint i;
- for (i = 0; i < sizeof (kwinfo) / sizeof (struct _kwinfo); i++)
+ for (i = 0; i < nitems(kwinfo); i++)
showdetails ((char *)kwinfo [i].name);
}
exit(0);