From owner-svn-src-all@FreeBSD.ORG Sat Mar 8 12:24:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A19836F; Sat, 8 Mar 2014 12:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56AF1C5D; Sat, 8 Mar 2014 12:24:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28COmne025865; Sat, 8 Mar 2014 12:24:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28COmjx025864; Sat, 8 Mar 2014 12:24:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403081224.s28COmjx025864@svn.freebsd.org> From: Christian Brueffer Date: Sat, 8 Mar 2014 12:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262926 - stable/10/usr.bin/hexdump X-SVN-Group: stable-10 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.17 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: Sat, 08 Mar 2014 12:24:48 -0000 Author: brueffer Date: Sat Mar 8 12:24:47 2014 New Revision: 262926 URL: http://svnweb.freebsd.org/changeset/base/262926 Log: MFC: r262333 Simplify the way the end of a singly linked list is followed (for adding items), so it is more obvious that we aren't going to indirect through a NULL pointer. PR: 144723 Submitted by: Garrett Cooper Obtained from: NetBSD r1.19 Modified: stable/10/usr.bin/hexdump/parse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/hexdump/parse.c ============================================================================== --- stable/10/usr.bin/hexdump/parse.c Sat Mar 8 06:06:50 2014 (r262925) +++ stable/10/usr.bin/hexdump/parse.c Sat Mar 8 12:24:47 2014 (r262926) @@ -210,7 +210,6 @@ rewrite(FS *fs) int nconv, prec; size_t len; - nextpr = NULL; prec = 0; for (fu = fs->nextfu; fu; fu = fu->nextfu) { @@ -218,13 +217,11 @@ rewrite(FS *fs) * Break each format unit into print units; each conversion * character gets its own. */ + nextpr = &fu->nextpr; for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) { if ((pr = calloc(1, sizeof(PR))) == NULL) err(1, NULL); - if (!fu->nextpr) - fu->nextpr = pr; - else - *nextpr = pr; + *nextpr = pr; /* Skip preceding text and up to the next % sign. */ for (p1 = fmtp; *p1 && *p1 != '%'; ++p1);