diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2019-06-03 19:50:33 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2019-06-03 19:50:33 +0000 |
commit | c627c71afa8524db228768513547b8d836cc40c0 (patch) | |
tree | f4a99d42f2187506668058afedf1c430bb299133 | |
parent | 6016e77859b9188cf40c3199e4c8df9314f9cd11 (diff) | |
download | mandoc-c627c71afa8524db228768513547b8d836cc40c0.tar.gz mandoc-c627c71afa8524db228768513547b8d836cc40c0.tar.zst mandoc-c627c71afa8524db228768513547b8d836cc40c0.zip |
Initialize the local variable "act" in print_mdoc_node().
While there is no bug, it helps clarity, and it is also safer in this
particular code because in case a bug gets introduced later, accessing
a NULL pointer is less dangerous than accessing an uninitialized pointer.
Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4
and 7.4.0 on illumos throw -Wuninitialized false positives.
-rw-r--r-- | mdoc_term.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 52ff27e1..c2f265c4 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.372 2019/01/04 03:39:01 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.373 2019/06/03 19:50:33 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2019 Ingo Schwarze <schwarze@openbsd.org> @@ -352,6 +352,7 @@ print_mdoc_node(DECL_ARGS) * produce output. Note that some pre-handlers do so. */ + act = NULL; switch (n->type) { case ROFFT_TEXT: if (n->flags & NODE_LINE) { |