Delete ban.txt if no bans to save

This commit is contained in:
James R 2020-10-24 15:59:11 -07:00
parent 288ffebea7
commit 9278f04fbf
1 changed files with 5 additions and 1 deletions

View File

@ -2870,11 +2870,15 @@ void D_SaveBan(void)
size_t i;
banreason_t *reasonlist = reasonhead;
const char *address, *mask;
const char *path = va("%s"PATHSEP"%s", srb2home, "ban.txt");
if (!reasonhead)
{
remove(path);
return;
}
f = fopen(va("%s"PATHSEP"%s", srb2home, "ban.txt"), "w");
f = fopen(path, "w");
if (!f)
{