version 1.9 | | version 1.10 |
---|
| | |
/* | | /* |
* static char *rcsid_ban_c = | | * static char *rcsid_ban_c = |
* "$Id: ban.c,v 1.9 2005/07/10 13:54:06 akirschbaum Exp $"; | | * "$Id: ban.c,v 1.10 2005/12/07 18:25:55 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <sys/file.h> | | #include <sys/file.h> |
#endif /* win32 */ | | #endif /* win32 */ |
| | |
| | /** |
| | * Check if a player and/or host is banned. |
| | * |
| | * @param login the player name to check; NULL to check only the host name |
| | * |
| | * @param host the host name to check |
| | * |
| | * @return 1=player/host is banned; 0=player/host is not banned |
| | */ |
int checkbanned(const char *login, const char *host) | | int checkbanned(const char *login, const char *host) |
{ | | { |
FILE *bannedfile; | | FILE *bannedfile; |
| | |
if(*log_buf=='*') | | if(*log_buf=='*') |
| | |
Hits=1; | | Hits=1; |
else if (!strcmp(login, log_buf)) | | else if (login != NULL && strcmp(login, log_buf) == 0) |
Hits=1; | | Hits=1; |
if(Hits==1) | | if(Hits==1) |
{ | | { |