Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2017 02:28:10 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319928 - head/sys/dev/vt/hw/vga
Message-ID:  <201706140228.v5E2SAs4020438@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706140228.v5E2SAs4020438>