Fix config bug (2)

This commit is contained in:
mintsuki 2020-07-02 16:20:18 +02:00
parent 78d1b8a8fc
commit e7669cadae
2 changed files with 2 additions and 5 deletions

Binary file not shown.

View File

@ -17,12 +17,11 @@ int init_config(int drive, int part) {
}
}
config_addr = balloc(f.size + 1);
size_t config_size = f.size + 1;
config_addr = balloc(config_size);
fread(&f, config_addr, 0, f.size);
size_t config_size = f.size;
// remove windows carriage returns, if any
for (size_t i = 0; i < config_size; i++) {
if (config_addr[i] == '\r') {
@ -32,8 +31,6 @@ int init_config(int drive, int part) {
}
}
config_addr[config_size-1] = 0;
return 0;
}