| 71 |
char *saveptr = NULL; |
char *saveptr = NULL; |
| 72 |
char *p, *q, *r; |
char *p, *q, *r; |
| 73 |
char *y, *m, *d; |
char *y, *m, *d; |
| 74 |
|
int v; |
| 75 |
FILE *fin; |
FILE *fin; |
| 76 |
|
|
| 77 |
// Load configuration |
// Load configuration |
| 155 |
BBS_max_client_per_ip = MAX_CLIENT_PER_IP_LIMIT; |
BBS_max_client_per_ip = MAX_CLIENT_PER_IP_LIMIT; |
| 156 |
} |
} |
| 157 |
} |
} |
|
else if (strcasecmp(p, "bbs_max_user") == 0) |
|
|
{ |
|
|
BBS_max_user = atoi(q); |
|
|
if (BBS_max_user <= 0 || BBS_max_user > BBS_MAX_USER_LIMIT) |
|
|
{ |
|
|
log_error("Ignore config bbs_max_client with incorrect value %d\n", BBS_max_user); |
|
|
BBS_max_user = BBS_MAX_USER_LIMIT; |
|
|
} |
|
|
} |
|
| 158 |
else if (strcasecmp(p, "bbs_start_dt") == 0) |
else if (strcasecmp(p, "bbs_start_dt") == 0) |
| 159 |
{ |
{ |
| 160 |
y = strtok_r(q, "-", &saveptr); |
y = strtok_r(q, "-", &saveptr); |
| 168 |
} |
} |
| 169 |
snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4s年%2s月%2s日", y, m, d); |
snprintf(BBS_start_dt, sizeof(BBS_start_dt), "%4s年%2s月%2s日", y, m, d); |
| 170 |
} |
} |
| 171 |
|
else if (strcasecmp(p, "bbs_sys_id") == 0) |
| 172 |
|
{ |
| 173 |
|
v = atoi(q); |
| 174 |
|
if (v <= 0) |
| 175 |
|
{ |
| 176 |
|
log_error("Ignore config bbs_sys_id with incorrect value %d\n", v); |
| 177 |
|
continue; |
| 178 |
|
} |
| 179 |
|
BBS_sys_id = v; |
| 180 |
|
} |
| 181 |
else if (strcasecmp(p, "db_host") == 0) |
else if (strcasecmp(p, "db_host") == 0) |
| 182 |
{ |
{ |
| 183 |
strncpy(DB_host, q, sizeof(DB_host) - 1); |
strncpy(DB_host, q, sizeof(DB_host) - 1); |