summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 00:15:41 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 00:15:41 +0000
commit60c5d7f50c39c55f1ac7121fb1391e4c49966824 (patch)
tree714f721dbbf90725784b75d8ac89e236d5072d9a /src/login
parent4426eb53903895faa1e3db6c7db6c75716906dd1 (diff)
downloadhercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.gz
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.bz2
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.tar.xz
hercules-60c5d7f50c39c55f1ac7121fb1391e4c49966824.zip
Some more changes for g++
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@972 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login')
-rw-r--r--src/login/login.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 11c970aca..1a0faddb0 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -186,7 +186,7 @@ int login_log(char *fmt, ...) {
else {
va_start(ap, fmt);
gettimeofday(&tv, NULL);
- strftime(tmpstr, 24, date_format, localtime(&(tv.tv_sec)));
+ strftime(tmpstr, 24, date_format, localtime((const time_t*)&(tv.tv_sec)));
sprintf(tmpstr + strlen(tmpstr), ".%03d: %s", (int)tv.tv_usec / 1000, fmt);
vfprintf(log_fp, tmpstr, ap);
va_end(ap);
@@ -326,14 +326,14 @@ int check_ipmask(unsigned int ip, const unsigned char *str) {
unsigned int mask = 0, i = 0, m, ip2, a0, a1, a2, a3;
unsigned char *p = (unsigned char *)&ip2, *p2 = (unsigned char *)&mask;
- if (sscanf(str, "%d.%d.%d.%d/%n", &a0, &a1, &a2, &a3, &i) != 4 || i == 0)
+ if (sscanf((const char*)str, "%d.%d.%d.%d/%n", &a0, &a1, &a2, &a3, &i) != 4 || i == 0)
return 0;
p[0] = a0; p[1] = a1; p[2] = a2; p[3] = a3;
- if (sscanf(str+i, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) == 4) {
+ if (sscanf((const char*)str+i, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) == 4) {
p2[0] = a0; p2[1] = a1; p2[2] = a2; p2[3] = a3;
mask = ntohl(mask);
- } else if (sscanf(str+i, "%d", &m) == 1 && m >= 0 && m <= 32) {
+ } else if (sscanf((const char*)(str+i), "%d", &m) == 1 && m >= 0 && m <= 32) {
for(i = 0; i < m && i < 32; i++)
mask = (mask >> 1) | 0x80000000;
} else {
@@ -372,7 +372,7 @@ int check_ip(unsigned int ip) {
for(i = 0; i < access_allownum; i++) {
access_ip = access_allow + i * ACO_STRSIZE;
- if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) {
+ if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) {
if(access_order == ACO_ALLOW_DENY)
return 1; // With 'allow, deny' (deny if not allow), allow has priority
flag = ACF_ALLOW;
@@ -382,7 +382,7 @@ int check_ip(unsigned int ip) {
for(i = 0; i < access_denynum; i++) {
access_ip = access_deny + i * ACO_STRSIZE;
- if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) {
+ if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) {
//flag = ACF_DENY; // not necessary to define flag
return 0; // At this point, if it's 'deny', we refuse connection.
}
@@ -420,7 +420,7 @@ int check_ladminip(unsigned int ip) {
for(i = 0; i < access_ladmin_allownum; i++) {
access_ip = access_ladmin_allow + i * ACO_STRSIZE;
- if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) {
+ if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) {
return 1;
}
}
@@ -431,7 +431,7 @@ int check_ladminip(unsigned int ip) {
//-----------------------------------------------------
// Function to suppress control characters in a string.
//-----------------------------------------------------
-int remove_control_chars(unsigned char *str) {
+int remove_control_chars(char *str) {
int i;
int change = 0;
@@ -448,9 +448,9 @@ int remove_control_chars(unsigned char *str) {
//---------------------------------------------------
// E-mail check: return 0 (not correct) or 1 (valid).
//---------------------------------------------------
-int e_mail_check(unsigned char *email) {
+int e_mail_check(char *email) {
char ch;
- unsigned char* last_arobas;
+ char* last_arobas;
// athena limits
if (strlen(email) < 3 || strlen(email) > 39)