refactor(optimize): use fixed size strings everywhere except for files

This commit is contained in:
2025-11-02 17:35:37 +01:00
parent b8bc021e69
commit 54ce876f6a
11 changed files with 52 additions and 49 deletions
+3 -8
View File
@@ -66,7 +66,7 @@ void file_update(File *file) {
File file_read(char *path) {
File file;
file.path = path;
sprintf(file.path, path, STR_LEN);
file.content = NULL;
file.error = false;
file.last_write = 0;
@@ -75,7 +75,7 @@ File file_read(char *path) {
return file;
}
void file_write(char *path, ConstStringArray lines) {
void file_write(char *path, StringArray lines) {
unsigned int i;
FILE *file_pointer;
@@ -105,9 +105,4 @@ void file_prepend(File *src, File extra) {
free(old_src_content);
}
void file_free(File *file, bool free_path) {
free(file->content);
if (free_path) {
free(file->path);
}
}
void file_free(File *file) { free(file->content); }