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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to