Fix parsing error

This commit is contained in:
2022-01-13 17:44:51 +01:00
parent 7d6fa4682d
commit 6ab65abec9

View File

@ -68,8 +68,9 @@ int config_load(const char *filename) {
fseek(file, 0, SEEK_END);
unsigned long len = ftell(file);
fseek(file, 0, SEEK_SET);
char *conf = alloca(len);
char *conf = alloca(len + 1);
fread(conf, 1, len, file);
conf[len] = 0;
fclose(file);
t_config *tmp_config = malloc(sizeof(t_config));