From owner-svn-src-all@freebsd.org Mon Sep 9 18:17:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EA4ADAE89; Mon, 9 Sep 2019 18:17:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RxGL6YJMz4M4B; Mon, 9 Sep 2019 18:17:30 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFDF419943; Mon, 9 Sep 2019 18:17:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x89IHUtZ008184; Mon, 9 Sep 2019 18:17:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x89IHUIi008183; Mon, 9 Sep 2019 18:17:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909091817.x89IHUIi008183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Sep 2019 18:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352092 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 352092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 18:17:31 -0000 Author: kevans Date: Mon Sep 9 18:17:30 2019 New Revision: 352092 URL: https://svnweb.freebsd.org/changeset/base/352092 Log: bectl(8): initialize reverse earlier This turns into a warning in GCC 4.2 that 'reverse' may be used uninitialized in this function. While I don't immediately see where it's deciding this from (there's only two paths that make column != NULL, and they both set reverse), initializing reverse earlier is good for clarity. MFC after: 3 days Modified: head/sbin/bectl/bectl_list.c Modified: head/sbin/bectl/bectl_list.c ============================================================================== --- head/sbin/bectl/bectl_list.c Mon Sep 9 18:07:31 2019 (r352091) +++ head/sbin/bectl/bectl_list.c Mon Sep 9 18:17:30 2019 (r352092) @@ -412,6 +412,7 @@ bectl_cmd_list(int argc, char *argv[]) props = NULL; printed = 0; bzero(&pc, sizeof(pc)); + reverse = false; while ((opt = getopt(argc, argv, "aDHsc:C:")) != -1) { switch (opt) { case 'a': @@ -463,10 +464,8 @@ bectl_cmd_list(int argc, char *argv[]) } /* List boot environments in alphabetical order by default */ - if (column == NULL) { + if (column == NULL) column = strdup("name"); - reverse = false; - } prop_list_sort(props, column, reverse);