project_files/frontlib/model/mapcfg.c
changeset 7497 7e1d72fc03c7
parent 7316 f7b49b2c5d84
child 10017 de822cd3df3a
equal deleted inserted replaced
7494:e65adfc99f15 7497:7e1d72fc03c7
    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 		}