summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-01 17:05:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-01 17:05:46 +0300
commitd66f863a4d2b31839b280af4146e9bad09835e23 (patch)
tree64bb0e4f794fc9a11e2dcba15e7853b386ac78e0
parent856f57d7fb05806cd676112a389ecf8be5ecf54e (diff)
downloadplugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.gz
plugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.bz2
plugin-d66f863a4d2b31839b280af4146e9bad09835e23.tar.xz
plugin-d66f863a4d2b31839b280af4146e9bad09835e23.zip
Fix possible wrong checks.
-rw-r--r--src/login/parse.c2
-rw-r--r--src/map/script.c2
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;