Browse Source

Merge pull request #36 from pocographdotcom/master

Cannot read config file properly.
pull/37/head
Max Lv 10 years ago
parent
commit
6fc5e1a0b1
1 changed files with 2 additions and 2 deletions
  1. 4
      src/jconf.c

4
src/jconf.c

@ -76,8 +76,8 @@ jconf_t *read_jconf(const char* file)
buf = malloc(pos + 1); buf = malloc(pos + 1);
if (buf == NULL) FATAL("No enough memory."); if (buf == NULL) FATAL("No enough memory.");
int err = fread(buf, pos, 1, f);
if (err) FATAL("Failed to read the config file.");
int nread = fread(buf, pos, 1, f);
if (!nread) FATAL("Failed to read the config file.");
fclose(f); fclose(f);
buf[pos] = '\0'; // end of string buf[pos] = '\0'; // end of string

Loading…
Cancel
Save