Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2017 18:27:35 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311110 - head/usr.bin/patch
Message-ID:  <201701021827.v02IRZ6R028604@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon Jan  2 18:27:35 2017
New Revision: 311110
URL: https://svnweb.freebsd.org/changeset/base/311110

Log:
  patch(1): replace strnlen() with a simpler strlen().
  
  Small style fix with here.
  
  Pointed out by:	kib

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

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.c	Mon Jan  2 18:23:31 2017	(r311109)
+++ head/usr.bin/patch/patch.c	Mon Jan  2 18:27:35 2017	(r311110)
@@ -749,10 +749,10 @@ rej_line(int ch, LINENUM i)
 	size_t len;
 	const char *line = pfetch(i);
 
-	len = strnlen(line, USHRT_MAX);
+	len = strlen(line);
 
 	fprintf(rejfp, "%c%s", ch, line);
-	if (len == 0 || line[len-1] != '\n') {
+	if (len == 0 || line[len - 1] != '\n') {
 		if (len >= USHRT_MAX)
 			fprintf(rejfp, "\n\\ Line too long\n");
 		else



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