diff options
-rw-r--r-- | sys/dev/wscons/wsemul_vt100_chars.c | 4 | ||||
-rw-r--r-- | sys/dev/wscons/wskbdutil.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/wscons/wsemul_vt100_chars.c b/sys/dev/wscons/wsemul_vt100_chars.c index a45d9d9e33f..373a34ab4fd 100644 --- a/sys/dev/wscons/wsemul_vt100_chars.c +++ b/sys/dev/wscons/wsemul_vt100_chars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100_chars.c,v 1.6 2007/11/27 16:37:27 miod Exp $ */ +/* $OpenBSD: wsemul_vt100_chars.c,v 1.7 2009/12/10 16:35:28 oga Exp $ */ /* $NetBSD: wsemul_vt100_chars.c,v 1.4 1999/02/20 18:20:02 drochner Exp $ */ /* @@ -150,7 +150,7 @@ vt100_setnrc(struct wsemul_vt100_emuldata *edp, int nrc) if (edp->nrctab == NULL) return (0); - if (nrc < 0 || nrc >= sizeof(nrctable) / sizeof(nrctable[0])) + if (nrc < 0 || nrc >= nitems(nrctable)) return (ERANGE); for (i = 0; i < 128; i++) diff --git a/sys/dev/wscons/wskbdutil.c b/sys/dev/wscons/wskbdutil.c index 7fb7a5af572..afeea7ef45e 100644 --- a/sys/dev/wscons/wskbdutil.c +++ b/sys/dev/wscons/wskbdutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbdutil.c,v 1.7 2008/06/26 05:42:19 ray Exp $ */ +/* $OpenBSD: wskbdutil.c,v 1.8 2009/12/10 16:35:28 oga Exp $ */ /* $NetBSD: wskbdutil.c,v 1.7 1999/12/21 11:59:13 drochner Exp $ */ /*- @@ -174,7 +174,7 @@ static struct compose_tab_s { { { KS_acute, KS_y }, KS_yacute } }; -#define COMPOSE_SIZE sizeof(compose_tab)/sizeof(compose_tab[0]) +#define COMPOSE_SIZE nitems(compose_tab) static int compose_tab_inorder = 0; @@ -428,7 +428,7 @@ wskbd_load_keymap(mapdata, map, maplen) mp++; } - if (stack_ptr == sizeof(stack)/sizeof(stack[0])) + if (stack_ptr == nitems(stack)) panic("wskbd_load_keymap: %d: recursion too deep", mapdata->layout); if (mp->map_size <= 0) |