diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-20 08:14:35 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-20 08:14:35 +0000 |
commit | 930cbe9d946f40e3698765b05b03f97df52fa471 (patch) | |
tree | c3e31bdbc6582dbe3cb9bbfc2bb5e10d43a006ba /src/login_sql | |
parent | c9c66502e813bcbcc40f4933d68577e4788c2193 (diff) | |
download | hercules-930cbe9d946f40e3698765b05b03f97df52fa471.tar.gz hercules-930cbe9d946f40e3698765b05b03f97df52fa471.tar.bz2 hercules-930cbe9d946f40e3698765b05b03f97df52fa471.tar.xz hercules-930cbe9d946f40e3698765b05b03f97df52fa471.zip |
* Abit of alterations to login-server.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6664 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r-- | src/login_sql/login.c | 12 | ||||
-rw-r--r-- | src/login_sql/login.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 7a40808ab..2d94aba2f 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -643,8 +643,8 @@ int mmo_auth( struct mmo_account* account , int fd){ jstrescapecpy(t_uid,account->userid);
if (account->passwdenc==PASSWORDENC) {
- memset(t_pass, 0, sizeof(t_pass));
- memcpy(t_pass, account->passwd, strlen(account->passwd));
+ memcpy(t_pass, account->passwd, NAME_LENGTH);
+ t_pass[24] = '\0';
} else
jstrescapecpy(t_pass, account->passwd);
@@ -1533,9 +1533,9 @@ int parse_login(int fd) { ShowInfo("client connection request %s from %d.%d.%d.%d\n", RFIFOP(fd, 6), p[0], p[1], p[2], p[3]);
account.version = RFIFOL(fd, 2);
- account.userid = (char*)RFIFOP(fd, 6);
+ memcpy(account.userid,RFIFOP(fd, 6),NAME_LENGTH);
account.userid[23] = '\0';
- account.passwd = (char*)RFIFOP(fd, 30);
+ memcpy(account.passwd,RFIFOP(fd, 30),NAME_LENGTH);
account.passwd[23] = '\0';
#ifdef PASSWORDENC
account.passwdenc= (RFIFOW(fd,0)==0x64)?0:PASSWORDENC;
@@ -1817,9 +1817,9 @@ int parse_login(int fd) { ShowInfo("server connection request %s @ %d.%d.%d.%d:%d (%d.%d.%d.%d)\n",
RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58),
p[0], p[1], p[2], p[3]);
- account.userid = (char*)RFIFOP(fd, 2);
+ memcpy(account.userid,RFIFOP(fd, 2),NAME_LENGTH);
account.userid[23] = '\0';
- account.passwd = (char*)RFIFOP(fd, 26);
+ memcpy(account.passwd,RFIFOP(fd, 26),NAME_LENGTH);
account.passwd[23] = '\0';
account.passwdenc = 0;
server_name = RFIFOP(fd,60);
diff --git a/src/login_sql/login.h b/src/login_sql/login.h index b1f6ee263..b215c7266 100644 --- a/src/login_sql/login.h +++ b/src/login_sql/login.h @@ -30,8 +30,8 @@ struct mmo_account {
int version; //Added by sirius for versioncheck
- char* userid;
- char* passwd;
+ char userid[NAME_LENGTH];
+ char passwd[NAME_LENGTH];
int passwdenc;
|