From 9be76c0b30a584a80c638bb54864bb9a9dc865e5 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Sun, 23 Oct 2022 18:44:30 +0300 Subject: [PATCH] cleanup: fix cppcheck unusedVariable code smells --- src/libespeak-ng/compiledata.c | 2 +- src/libespeak-ng/soundicon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 9d829157..62bbb30b 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -1207,13 +1207,13 @@ static int LoadWavefile(FILE *f, const char *fname) fseek(f, 40, SEEK_SET); if ((sr1 != samplerate_native) || (sr2 != sr1*2)) { - int fd_temp; char command[sizeof(path_home)+250]; failed = false; #ifdef HAVE_MKSTEMP strcpy(fname_temp, "/tmp/espeakXXXXXX"); + int fd_temp; if ((fd_temp = mkstemp(fname_temp)) >= 0) close(fd_temp); #else diff --git a/src/libespeak-ng/soundicon.c b/src/libespeak-ng/soundicon.c index 25a3130b..7b883528 100644 --- a/src/libespeak-ng/soundicon.c +++ b/src/libespeak-ng/soundicon.c @@ -72,7 +72,6 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER f = NULL; if ((f = fopen(fname, "rb")) != NULL) { int ix; - int fd_temp; int header[3]; char command[sizeof(fname2)+sizeof(fname2)+40]; @@ -92,6 +91,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER #ifdef HAVE_MKSTEMP strcpy(fname_temp, "/tmp/espeakXXXXXX"); + int fd_temp; if ((fd_temp = mkstemp(fname_temp)) >= 0) close(fd_temp); #else