Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Mar 2017 06:23:15 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314993 - head/usr.bin/uuencode
Message-ID:  <201703100623.v2A6NFwm086973@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Fri Mar 10 06:23:15 2017
New Revision: 314993
URL: https://svnweb.freebsd.org/changeset/base/314993

Log:
  Use nitems() from sys/param.h.
  
  Reviewed by:	ngie
  MFC after:	3 weeks.
  Differential Revision:	https://reviews.freebsd.org/D9936

Modified:
  head/usr.bin/uuencode/uuencode.c

Modified: head/usr.bin/uuencode/uuencode.c
==============================================================================
--- head/usr.bin/uuencode/uuencode.c	Fri Mar 10 06:18:27 2017	(r314992)
+++ head/usr.bin/uuencode/uuencode.c	Fri Mar 10 06:23:15 2017	(r314993)
@@ -160,7 +160,7 @@ base64_encode(void)
 		fprintf(output, "begin-base64 %o %s\n", mode, *av);
 	while ((n = fread(buf, 1, sizeof(buf), stdin))) {
 		++sequence;
-		rv = b64_ntop(buf, n, buf2, (sizeof(buf2) / sizeof(buf2[0])));
+		rv = b64_ntop(buf, n, buf2, nitems(buf2));
 		if (rv == -1)
 			errx(1, "b64_ntop: error encoding base64");
 		fprintf(output, "%s%s", buf2, (sequence % GROUPS) ? "" : "\n");



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