From owner-svn-src-head@freebsd.org Mon Jan 2 18:27:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F49C9C48A; Mon, 2 Jan 2017 18:27:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82C761CF7; Mon, 2 Jan 2017 18:27:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v02IRZAb028605; Mon, 2 Jan 2017 18:27:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v02IRZ6R028604; Mon, 2 Jan 2017 18:27:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701021827.v02IRZ6R028604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 2 Jan 2017 18:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311110 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2017 18:27:36 -0000 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