Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2017 21:05:15 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r321087 - stable/11/sys/dev/vt/hw/vga
Message-ID:  <201707172105.v6HL5FdD054117@repo.freebsd.org>

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



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