diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-01 17:05:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-01 17:05:46 +0300 |
commit | d66f863a4d2b31839b280af4146e9bad09835e23 (patch) | |
tree | 64bb0e4f794fc9a11e2dcba15e7853b386ac78e0 | |
parent | 856f57d7fb05806cd676112a389ecf8be5ecf54e (diff) | |
download | plugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.gz plugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.bz2 plugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.xz plugin-d66f863a4d2b31839b280af4146e9bad09835e23.zip |
Fix possible wrong checks.
-rw-r--r-- | src/login/parse.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/login/parse.c b/src/login/parse.c index 53fa28f..d803843 100644 --- a/src/login/parse.c +++ b/src/login/parse.c @@ -82,7 +82,7 @@ void elogin_parse_client_login2(int fd) safestrncpy(username, (const char*)RFIFOP(fd, 2), NAME_LENGTH); int len = strnlen(username, NAME_LENGTH); - if (len < 2 || !username[len - 2] == '_' || !memchr("FfMm", username[len - 1], 4)) + if (len < 2 || !(username[len - 2] == '_') || !memchr("FfMm", username[len - 1], 4)) { login->login_error(fd, 3); return; diff --git a/src/map/script.c b/src/map/script.c index fd54d5b..fe014dd 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -456,7 +456,7 @@ BUILDIN(getq) getSDReturn(0); int quest_id = script_getnum(st, 2); - if (!quest->check(sd, quest_id, HAVEQUEST) < 0) + if (quest->check(sd, quest_id, HAVEQUEST) < 0) { script_pushint(st, 0); return true; |