bad variable reuse leads to gcc confusion

This commit is contained in:
Enno Rehling 2015-10-29 12:04:52 +01:00
parent 8b6da79984
commit 5f4c31af1c
1 changed files with 5 additions and 4 deletions

View File

@ -65,14 +65,15 @@ int config_read(const char *filename, const char * relpath)
F = fopen(filename, "rt");
}
if (F) {
long result;
long size;
int result;
char *data;
fseek(F, 0, SEEK_END);
result = ftell(F);
size = ftell(F);
rewind(F);
if (result > 0) {
size_t sz = (size_t)result;
if (size > 0) {
size_t sz = (size_t)size;
data = malloc(sz);
fread(data, 1, sz, F);
fclose(F);