allocate space for null terminator

This commit is contained in:
Enno Rehling 2015-10-30 12:08:09 +01:00
parent 7fa12ae3af
commit 54304af182
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ int config_read(const char *filename, const char * relpath)
char *data;
size_t sz = (size_t)size;
data = malloc(sz);
data = malloc(sz+1);
sz = fread(data, 1, sz, F);
data[sz] = 0;
fclose(F);