From owner-svn-src-head@freebsd.org Fri Feb 17 19:53:22 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 76928CE3926; Fri, 17 Feb 2017 19:53:22 +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 2D2E816DA; Fri, 17 Feb 2017 19:53:22 +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 v1HJrLvW083359; Fri, 17 Feb 2017 19:53:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HJrLKm083356; Fri, 17 Feb 2017 19:53:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702171953.v1HJrLKm083356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Feb 2017 19:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313891 - head/usr.bin/sort 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: Fri, 17 Feb 2017 19:53:22 -0000 Author: pfg Date: Fri Feb 17 19:53:20 2017 New Revision: 313891 URL: https://svnweb.freebsd.org/changeset/base/313891 Log: sort(1): Remove unneeded initializations. Found by: Clang static analyzer Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/coll.c head/usr.bin/sort/file.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/bwstring.c Fri Feb 17 19:53:20 2017 (r313891) @@ -268,7 +268,7 @@ bwscsbdup(const unsigned char *str, size const char *s; size_t charlen, chars, cptr; - charlen = chars = 0; + chars = 0; cptr = 0; s = (const char *) str; @@ -581,7 +581,6 @@ bwsncmp(const struct bwstring *bws1, con size_t cmp_len, len1, len2; int res = 0; - cmp_len = 0; len1 = bws1->len; len2 = bws2->len; Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/coll.c Fri Feb 17 19:53:20 2017 (r313891) @@ -330,8 +330,6 @@ find_field_end(const struct bwstring *s, size_t f2, next_field_start, pos_end; bool empty_field, empty_key; - pos_end = 0; - next_field_start = 0; empty_field = false; empty_key = false; f2 = ks->f2; @@ -827,7 +825,6 @@ numcoll_impl(struct key_value *kv1, stru main1 = main2 = 0; frac1 = frac2 = 0; - cmp_res = 0; key1_read = key2_read = false; if (debug_sort) { Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/file.c Fri Feb 17 19:53:20 2017 (r313891) @@ -631,7 +631,6 @@ file_reader_init(const char *fsrc) int fd, flags; flags = MAP_NOCORE | MAP_NOSYNC; - addr = MAP_FAILED; fd = open(fsrc, O_RDONLY); if (fd < 0)