From 55243369ebf34a11fb613d1fe9bb67cc3d6b2400 Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Sun, 31 Jan 2021 16:20:08 +0100 Subject: [PATCH] Silence a spurious "maybe uninitialized" error. mlb-rt11.c: In function 'mlb_rt11_entry': mlb-rt11.c:284:27: warning: 'ent' may be used uninitialized in this function [-Wmaybe-uninitialized] buffer_resize(buf, ent->length + 1); /* Make it large enough */ ~~~^~~~~~~~ It is spurious because ent gets initialized in the loop above. If the loop is never executed, this must be because 0 >= mlb->nentries and NULL is returned, so the buffer_resize() is never reached. --- mlb-rt11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlb-rt11.c b/mlb-rt11.c index 4bdd146..2e10f88 100644 --- a/mlb-rt11.c +++ b/mlb-rt11.c @@ -265,7 +265,7 @@ BUFFER *mlb_rt11_entry( char *name) { int i; - MLBENT *ent; + MLBENT *ent = NULL; BUFFER *buf; char *bp; int c;