commit 2f79e5b9ed935de02826b2e4342cfd6c9e4a3e09
parent 66773ab9a8ab5cadce6cdbeae4e7befbaa449db7
Author: Henry Unite <unitehenry@gmail.com>
Date: Thu, 9 Apr 2026 02:52:08 +0000
feat: determine filepath len
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
@@ -29,7 +29,9 @@ void get_content_files(StringList *list, char *content_path) {
continue;
}
- char filepath[256];
+ size_t filepath_len = strlen(content_path) + strlen(de->d_name) + 2;
+
+ char filepath[filepath_len];
snprintf(filepath, sizeof(filepath), "%s/%s", content_path, de->d_name);