Use nitems() from sys/param.h.

Reviewed by:	ngie
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9936
This commit is contained in:
araujo 2017-03-10 06:23:15 +00:00
parent 7f7e319aaf
commit 1fd17330b6

View File

@ -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");