svn commit: r311110 - head/usr.bin/patch

Pedro F. Giffuni pfg at FreeBSD.org
Mon Jan 2 18:27:36 UTC 2017


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


More information about the svn-src-head mailing list