mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Fix IPv6 bans being ignored when loading banlist
This commit is contained in:
parent
99d0310433
commit
0131cdb03d
1 changed files with 9 additions and 1 deletions
|
@ -79,7 +79,7 @@ static void Ban_Clear(void)
|
|||
void Ban_Load_File(boolean warning)
|
||||
{
|
||||
FILE *f;
|
||||
const char *address, *mask;
|
||||
char *address, *mask;
|
||||
char buffer[MAX_WADPATH];
|
||||
|
||||
if (!I_ClearBans)
|
||||
|
@ -100,6 +100,14 @@ void Ban_Load_File(boolean warning)
|
|||
{
|
||||
address = strtok(buffer, " \t\r\n");
|
||||
mask = strtok(NULL, " \t\r\n");
|
||||
if (address[0] == '[')
|
||||
{
|
||||
size_t len;
|
||||
address++;
|
||||
len = strlen(address);
|
||||
if (address[len-1] == ']')
|
||||
address[len-1] = '\0';
|
||||
}
|
||||
|
||||
I_SetBanAddress(address, mask);
|
||||
|
||||
|
|
Loading…
Reference in a new issue