Add .xxx TLD to country(), and some more const-correctness.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@122 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2011-04-17 03:33:00 +00:00
parent 780ac2c149
commit df5547af72
2 changed files with 6 additions and 4 deletions

View File

@@ -118,7 +118,7 @@ ChannelList * BX_prepare_command (int *, char *, int);
int timer_unban (void *, char *);
void check_server_connect (int);
const char *country(char *);
const char *country(const char *);
int do_newuser (char *, char *, char *);
int char_fucknut (register unsigned char *, char, int);
BanList *ban_is_on_channel(register char *, register ChannelList *);

View File

@@ -4902,7 +4902,7 @@ void check_server_connect(int server)
#endif
}
const char *country(char *hostname)
const char *country(const char *hostname)
{
#ifndef BITCHX_LITE
static const struct {
@@ -5181,10 +5181,12 @@ static const struct {
{"PRO", "Professional" },
{"TEL", "Contact Information" },
{"TRAVEL", "Travel Industry" },
{"XXX", "Porn" },
{NULL, NULL}
};
char *p;
const char *p;
int i = 0;
if (!hostname || !*hostname || isdigit((unsigned char)hostname[strlen(hostname)-1]))
return "unknown";
if ((p = strrchr(hostname, '.')))