From e6b01ed73a2afc408792ef181e4689421d87f105 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Wed, 14 Jun 2017 02:28:10 +0000 Subject: [PATCH] Use nitems(..) when computing `max` instead of the longhand version of the same logic MFC after: 1 month --- sys/dev/vt/hw/vga/vt_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c index 9788b7e67265..502aaca3377d 100644 --- a/sys/dev/vt/hw/vga/vt_vga.c +++ b/sys/dev/vt/hw/vga/vt_vga.c @@ -288,7 +288,7 @@ vga_get_cp437(term_char_t c) int min, mid, max; min = 0; - max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + max = nitems(cp437table) - 1; if (c < cp437table[0].unicode_base || c > cp437table[max].unicode_base + cp437table[max].length)