svn commit: r321087 - stable/11/sys/dev/vt/hw/vga

Ngie Cooper ngie at FreeBSD.org
Mon Jul 17 21:05:17 UTC 2017


Author: ngie
Date: Mon Jul 17 21:05:15 2017
New Revision: 321087
URL: https://svnweb.freebsd.org/changeset/base/321087

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

Modified:
  stable/11/sys/dev/vt/hw/vga/vt_vga.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/vt/hw/vga/vt_vga.c
==============================================================================
--- stable/11/sys/dev/vt/hw/vga/vt_vga.c	Mon Jul 17 21:01:10 2017	(r321086)
+++ stable/11/sys/dev/vt/hw/vga/vt_vga.c	Mon Jul 17 21:05:15 2017	(r321087)
@@ -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-stable-11 mailing list