From 5289c5e773b673b926f0360688c30946d498ed30 Mon Sep 17 00:00:00 2001 From: Shinya Kato Date: Thu, 5 Sep 2024 12:00:46 +0900 Subject: [PATCH] Fix compile warning -Wunused-but-set-variable --- data.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/data.c b/data.c index f96498f..6bf32a7 100644 --- a/data.c +++ b/data.c @@ -1267,11 +1267,13 @@ figure_out_segno(char *filepath) if ((filename = strrchr(filepath, '/')) != NULL) { - int scanned; unsigned int relfilenode = 0; - - scanned = sscanf((char *) filename + 1, "%u.%d", &relfilenode, &segno); +#ifdef USE_ASSERT_CHECKING + int scanned = sscanf((char *) filename + 1, "%u.%d", &relfilenode, &segno); Assert(scanned > 0); +#else + sscanf((char *) filename + 1, "%u.%d", &relfilenode, &segno); +#endif } return segno;