svn commit: r319928 - head/sys/dev/vt/hw/vga

Ngie Cooper ngie at FreeBSD.org
Wed Jun 14 02:28:11 UTC 2017


Author: ngie
Date: Wed Jun 14 02:28:10 2017
New Revision: 319928
URL: https://svnweb.freebsd.org/changeset/base/319928

Log:
  Use nitems(..) when computing `max` instead of the longhand version of
  the same logic
  
  MFC after:	1 month

Modified:
  head/sys/dev/vt/hw/vga/vt_vga.c

Modified: head/sys/dev/vt/hw/vga/vt_vga.c
==============================================================================
--- head/sys/dev/vt/hw/vga/vt_vga.c	Wed Jun 14 01:59:41 2017	(r319927)
+++ head/sys/dev/vt/hw/vga/vt_vga.c	Wed Jun 14 02:28:10 2017	(r319928)
@@ -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)


More information about the svn-src-head mailing list