Merge branch 'fix-parse-ipv6-ban' into 'next'

Fix IPv6 bans being ignored when loading banlist

See merge request STJr/SRB2!2235
This commit is contained in:
Logan Aerl Arias 2023-12-25 23:55:00 +00:00
commit 5250ddca52

View file

@ -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);