44 FILE *file = fopen(path, "rb"); |
44 FILE *file = fopen(path, "rb"); |
45 if(!log_e_if(!file, "Unable to open map config file %s", path)) { |
45 if(!log_e_if(!file, "Unable to open map config file %s", path)) { |
46 if(!log_e_if(!fgets(out->theme, sizeof(out->theme), file), "Error reading theme from %s", path)) { |
46 if(!log_e_if(!fgets(out->theme, sizeof(out->theme), file), "Error reading theme from %s", path)) { |
47 removeNewline(out->theme); |
47 removeNewline(out->theme); |
48 char buf[64]; |
48 char buf[64]; |
49 if(!log_e_if(!fgets(buf, sizeof(buf), file), "Error reading hoglimit from %s", path)) { |
49 if(fgets(buf, sizeof(buf), file)) { |
50 removeNewline(buf); |
50 removeNewline(buf); |
51 errno = 0; |
51 errno = 0; |
52 out->hogLimit = strtol(buf, NULL, 10); |
52 out->hogLimit = strtol(buf, NULL, 10); |
53 result = !log_e_if(errno, "Invalid hoglimit in %s: %i", path, buf); |
53 result = !log_e_if(errno, "Invalid hoglimit in %s: %i", path, buf); |
|
54 } else { |
|
55 result = 0; |
54 } |
56 } |
55 } |
57 } |
56 fclose(file); |
58 fclose(file); |
57 } |
59 } |
58 } |
60 } |