summaryrefslogtreecommitdiff
path: root/usr.bin/hexdump
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2014-02-22 10:15:27 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2014-02-22 10:15:27 +0000
commit8c91e67c8c2b665924011218feaff82054265c5f (patch)
tree78f0dbad7b23c4917ec96bf0f7153dda4ddb71fe /usr.bin/hexdump
parentc4f5dc40a097a9bad578da93bf4a7a3ec19f1f3f (diff)
downloadsrc-test2-8c91e67c8c2b665924011218feaff82054265c5f.tar.gz
src-test2-8c91e67c8c2b665924011218feaff82054265c5f.zip
Notes
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r--usr.bin/hexdump/parse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c
index b10ce01948ba..10db904dc0e6 100644
--- a/usr.bin/hexdump/parse.c
+++ b/usr.bin/hexdump/parse.c
@@ -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);