From b2b5076af1655f59124652ee844a35483df5dfc6 Mon Sep 17 00:00:00 2001 From: L-diy Date: Thu, 16 Nov 2023 16:03:36 +0100 Subject: [PATCH] Fix zero file bug in mkllfs --- mkllfs/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkllfs/main.c b/mkllfs/main.c index 6c21641..fd11f8c 100644 --- a/mkllfs/main.c +++ b/mkllfs/main.c @@ -1,7 +1,7 @@ /** * @file main.c * @brief Converts files to a C file that can be used by llfs (linked list file system). - * @version 0.2.0 + * @version 0.2.1 * @author Lorenz C. */ @@ -10,7 +10,7 @@ #include #include "tinydir.h" -#define VERSION "0.2.0" +#define VERSION "0.2.1" #define LLFS_VERSION "0.1.1" #define MAX_PATH_LEN 256 @@ -125,7 +125,7 @@ int main(int argc, char** argv) { // Make the last file the root file of the llfs fprintf(out_file, "\n"); - fprintf(out_file, "const struct llfs_data_file *llfs_root = &%s;\n", prev_llfs_name); + fprintf(out_file, "const struct llfs_data_file *llfs_root =%s%s;\n", (strcmp(prev_llfs_name, "NULL") == 0 ? " " : " &"), prev_llfs_name); // Print the number of files printf("Successfully converted %d files.\r\n", file_count);