From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Tue, 14 Jul 2020 14:01:15 -0400 Subject: [Cluster-devel] [PATCH dlm-tool 3/4] dlm_controld: fix may be used uninitialized In-Reply-To: <20200714180116.18642-1-aahringo@redhat.com> References: <20200714180116.18642-1-aahringo@redhat.com> Message-ID: <20200714180116.18642-4-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch fixes the following compiler warning: config.c:269:26: warning: ?val? may be used uninitialized in this function [-Wmaybe-uninitialized] 269 | o->file_int = val ? 1 : 0; The fix just init's val to 0 to have a fallback if parsing fails. --- dlm_controld/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlm_controld/config.c b/dlm_controld/config.c index ec269168..323f91e9 100644 --- a/dlm_controld/config.c +++ b/dlm_controld/config.c @@ -189,7 +189,7 @@ void set_opt_file(int update) FILE *file; char line[MAX_LINE]; char str[MAX_LINE]; - int i, val; + int i, val = 0; if (!path_exists(CONF_FILE_PATH)) return; -- 2.26.2