Compare commits

..
2 Commits
Author SHA1 Message Date
syedm d484db4e84 Format files (using clang-format) 2026-07-26 19:17:24 +01:00
syedm f82ab718f3 Make fread call error handle 2026-07-26 19:12:32 +01:00
18 changed files with 25 additions and 18 deletions
+8 -1
View File
@@ -15,7 +15,14 @@ int main(int argc, char *argv[]) {
fseek(file, 0, SEEK_SET);
char *script_content = (char *)malloc(size + 1);
fread(script_content, 1, size, file);
size_t read = fread(script_content, 1, size, file);
if (read != size) {
fprintf(stderr, "Failed to read startup script: %s\n", startup_script);
free(script_content);
fclose(file);
return 1;
}
script_content[size] = '\0';
fclose(file);