From ada2d17a1b9026b484990bdd0ef1e8b9e6cf7079 Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Sun, 31 Jan 2021 16:16:05 +0100 Subject: [PATCH] Silence a spurious "maybe uninitialized" error. mlb-rsx.c: In function 'mlb_rsx_entry': mlb-rsx.c:374:23: warning: 'ent' may be used uninitialized in this function [-Wmaybe-uninitialized] fseek(mlb->fp, ent->position, SEEK_SET); ~~~^~~~~~~~~~ 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 fseek() is never reached. --- mlb-rsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlb-rsx.c b/mlb-rsx.c index 66ad28b..c86bc62 100644 --- a/mlb-rsx.c +++ b/mlb-rsx.c @@ -354,7 +354,7 @@ BUFFER *mlb_rsx_entry( char *name) { int i; - MLBENT *ent; + MLBENT *ent = NULL; BUFFER *buf; char *bp; int c;