commit e8f967d3ef1ba327d0d0e909316df5e562f33bb6
parent 5254198e2e439cf7ec24c0652ae5d7b9baee911f
Author: Frederic Cambus <fred@statdns.com>
Date: Mon, 19 Oct 2020 11:29:46 +0200
Move read_status variable declaration to the top of the function.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/sauce.c b/src/sauce.c
@@ -47,11 +47,13 @@ sauceReadFile(FILE *file)
void
readRecord(FILE *file, struct sauce *record)
{
+ size_t read_status;
+
if (fseek(file, 0 - RECORD_SIZE, SEEK_END) != 0) {
return;
}
- size_t read_status = fread(record->ID, sizeof (record->ID) - 1, 1, file);
+ read_status = fread(record->ID, sizeof (record->ID) - 1, 1, file);
record->ID[sizeof (record->ID) - 1] = '\0';
if (read_status != 1 || strcmp(record->ID, SAUCE_ID) != 0) {