aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-06-03 19:58:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-06-03 19:58:02 +0000
commit8238052233df39761f179f81db886271c18f4cd4 (patch)
tree0727b6372f44e5d11f33c079528fc88e5e6cb2b3 /read.c
parentc627c71afa8524db228768513547b8d836cc40c0 (diff)
downloadmandoc-8238052233df39761f179f81db886271c18f4cd4.tar.gz
mandoc-8238052233df39761f179f81db886271c18f4cd4.tar.zst
mandoc-8238052233df39761f179f81db886271c18f4cd4.zip
Initialize the local variable "lastln" in mparse_buf_r().
While there is no bug, it logically makes sense given the meaning of the variable that lastln is NULL as long as firstln is NULL. Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4 and 7.4.0 on illumos throw -Wuninitialized false positives.
Diffstat (limited to 'read.c')
-rw-r--r--read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read.c b/read.c
index b9d67854..6c27a47a 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.212 2019/03/19 16:26:08 schwarze Exp $ */
+/* $Id: read.c,v 1.213 2019/06/03 19:58:02 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -157,7 +157,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
ln.sz = 256;
ln.buf = mandoc_malloc(ln.sz);
ln.next = NULL;
- firstln = loop = NULL;
+ firstln = lastln = loop = NULL;
lnn = curp->line;
pos = 0;
inloop = 0;