summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-26 16:35:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-31 23:07:45 +0300
commitf70d54001cd1b975db6f4668a6d54dbae7a8ac92 (patch)
tree9025875d74dda4dfb6766c555aba04700d8d0423 /src/login
parent0a9cee0a94185f9fabd8fd615139836a64d369f2 (diff)
downloadhercules-f70d54001cd1b975db6f4668a6d54dbae7a8ac92.tar.gz
hercules-f70d54001cd1b975db6f4668a6d54dbae7a8ac92.tar.bz2
hercules-f70d54001cd1b975db6f4668a6d54dbae7a8ac92.tar.xz
hercules-f70d54001cd1b975db6f4668a6d54dbae7a8ac92.zip
Improve performance a bit by removing strlen(str) > 0.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/login.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login/login.c b/src/login/login.c
index c006d9c45..e5f565644 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -409,7 +409,7 @@ void login_fromchar_account(int fd, int account_id, struct mmo_account *acc)
char_slots = acc->char_slots;
safestrncpy(pincode, acc->pincode, sizeof(pincode));
safestrncpy(birthdate, acc->birthdate, sizeof(birthdate));
- if( strlen(pincode) == 0 )
+ if (pincode[0] == '\0')
memset(pincode,'\0',sizeof(pincode));
safestrncpy((char*)WFIFOP(fd,6), email, 40);
@@ -1097,9 +1097,9 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
// Account creation with _M/_F
if( login_config.new_account_flag ) {
- if( len > 2 && strnlen(sd->passwd, NAME_LENGTH) > 0 && // valid user and password lengths
+ if (len > 2 && sd->passwd[0] != '\0' && // valid user and password lengths
sd->passwdenc == 0 && // unencoded password
- sd->userid[len-2] == '_' && memchr("FfMm", sd->userid[len-1], 4) ) // _M/_F suffix
+ sd->userid[len-2] == '_' && memchr("FfMm", sd->userid[len-1], 4)) // _M/_F suffix
{
int result;