Fix crash on startup
This commit is contained in:
parent
9097ab49e0
commit
874edab837
3
main.c
3
main.c
@ -116,7 +116,7 @@ static int protocol_config_handler(void* user, const char* section, const char*
|
|||||||
conf->protocols = (struct protocol **)realloc(conf->protocols, sizeof(struct protocol *) * (conf->protocol_count + 1));
|
conf->protocols = (struct protocol **)realloc(conf->protocols, sizeof(struct protocol *) * (conf->protocol_count + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->protocols[conf->protocol_count] = (struct protocol *)malloc(sizeof(struct archiver));
|
conf->protocols[conf->protocol_count] = (struct protocol *)malloc(sizeof(struct protocol));
|
||||||
|
|
||||||
conf->protocols[conf->protocol_count]->name = strdup(section);
|
conf->protocols[conf->protocol_count]->name = strdup(section);
|
||||||
conf->protocols[conf->protocol_count]->internal_zmodem = 0;
|
conf->protocols[conf->protocol_count]->internal_zmodem = 0;
|
||||||
@ -1102,6 +1102,7 @@ int main(int argc, char **argv) {
|
|||||||
conf.ipguard_tries = 4;
|
conf.ipguard_tries = 4;
|
||||||
conf.ipguard_timeout = 120;
|
conf.ipguard_timeout = 120;
|
||||||
conf.protocol_count = 0;
|
conf.protocol_count = 0;
|
||||||
|
|
||||||
// Load BBS data
|
// Load BBS data
|
||||||
if (ini_parse(argv[1], handler, &conf) <0) {
|
if (ini_parse(argv[1], handler, &conf) <0) {
|
||||||
fprintf(stderr, "Unable to load configuration ini (%s)!\n", argv[1]);
|
fprintf(stderr, "Unable to load configuration ini (%s)!\n", argv[1]);
|
||||||
|
Reference in New Issue
Block a user