diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 14:25:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-26 14:25:37 +0000 |
commit | 005f4614e8fd5d75dfda33c77a1fb8622ea2e82d (patch) | |
tree | 21f9bdf99d18f1b04e9cf4f9d310936505ef9b34 /sbin/disklabel | |
parent | a4afd6bf9a68e074d30d51d11ba8213183e50632 (diff) |
since nitems() is not yet fit for userland consumption, provide it
ourselves
ok krw
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 3e1e5ed6edd..d85387dafa5 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.218 2009/06/11 02:59:08 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.219 2009/06/26 14:25:36 deraadt Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.218 2009/06/11 02:59:08 krw Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.219 2009/06/26 14:25:36 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -102,6 +102,10 @@ const struct space_allocation alloc_stupid[] = { { MEG(1), MEG(2048), 100, "/" } }; +#ifndef nitems +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + const struct { const struct space_allocation *table; int sz; |