From d66f863a4d2b31839b280af4146e9bad09835e23 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 May 2015 17:05:46 +0300 Subject: Fix possible wrong checks. --- src/login/parse.c | 2 +- src/map/script.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2