From c627c71afa8524db228768513547b8d836cc40c0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Jun 2019 19:50:33 +0000 Subject: 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 reported that gcc 4.4.4 and 7.4.0 on illumos throw -Wuninitialized false positives. --- mdoc_term.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mdoc_term.c') 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 * Copyright (c) 2010, 2012-2019 Ingo Schwarze @@ -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) { -- cgit v1.2.3