From d5242a8225228d102a38ec46697519724e0a094f Mon Sep 17 00:00:00 2001 From: Sergei Ianovich Date: Tue, 30 Jul 2024 15:04:04 +0000 Subject: [PATCH] Fix double initialization Infer correctly complains that `ptr` is initialized twice before first use. The fix is trivial. ``` gost12sum.c:253: error: Dead Store The value written to `&ptr` is never used. 251. { 252. int i, len; 253. char *ptr = filename; ^ 254. char *spacepos = NULL; 255. ``` --- gost12sum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gost12sum.c b/gost12sum.c index e644a61..7e443d3 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -250,7 +250,7 @@ int hash_stream(gost_hash_ctx * ctx, int fd, char *sum, int hashsize) int get_line(FILE *f, char *hash, char *filename, int verbose, int *size) { int i, len; - char *ptr = filename; + char *ptr; char *spacepos = NULL; while (!feof(f)) { -- 2.39.5