From 1d8f89eec6f63e7f3f1b181f93b90dde7c2109b1 Mon Sep 17 00:00:00 2001 From: brueffer Date: Sat, 8 Mar 2014 12:26:17 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.freebsd.org/base/stable/8@262928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/hexdump/parse.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index 5354675ad..ffd18c080 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -214,7 +214,6 @@ rewrite(FS *fs) int nconv, prec; size_t len; - nextpr = NULL; prec = 0; for (fu = fs->nextfu; fu; fu = fu->nextfu) { @@ -222,13 +221,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); -- 2.45.0