summaryrefslogtreecommitdiffstats
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
commit8f2bcb5ca5f5c3c6751948208d0284cedef931ef (patch)
treef832f299fc039c9a6653d93c0d8c89866f3b140e /read.c
parentdaa462ce407538b363fe9ffa864ed82ff958ebb1 (diff)
downloadmandoc-8f2bcb5ca5f5c3c6751948208d0284cedef931ef.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read.c b/read.c
index 76c4308e..4de97901 100644
--- a/read.c
+++ b/read.c
@@ -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;