From 673849b420f8e1cae5bf39f6dff4e93d6d6dd5be Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 30 Apr 2013 14:01:29 +0200 Subject: [PATCH] check that the flag is set to what we check since we overload flags in curious ways it's important to check that the flag is set to the thing we check for, not just set. --- ykpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ykpers.c b/ykpers.c index 5945104..7931a26 100644 --- a/ykpers.c +++ b/ykpers.c @@ -773,7 +773,7 @@ int ykp_set_tktflag_ ## type(YKP_CONFIG *cfg, bool state) \ bool ykp_get_tktflag_ ## type(YKP_CONFIG *cfg) \ { \ if (cfg) { \ - if(cfg->ykcore_config.tktFlags & TKTFLAG_ ## type) \ + if((cfg->ykcore_config.tktFlags & TKTFLAG_ ## type) == TKTFLAG_ ## type) \ return true; \ else \ return false; \ @@ -803,7 +803,7 @@ int ykp_set_cfgflag_ ## type(YKP_CONFIG *cfg, bool state) \ bool ykp_get_cfgflag_ ## type(YKP_CONFIG *cfg) \ { \ if (cfg) { \ - if(cfg->ykcore_config.cfgFlags & CFGFLAG_ ## type) \ + if((cfg->ykcore_config.cfgFlags & CFGFLAG_ ## type) == CFGFLAG_ ## type) \ return true; \ else \ return false; \ @@ -832,7 +832,7 @@ int ykp_set_extflag_ ## type(YKP_CONFIG *cfg, bool state) \ bool ykp_get_extflag_ ## type(YKP_CONFIG *cfg) \ { \ if (cfg) { \ - if(cfg->ykcore_config.extFlags & EXTFLAG_ ## type) \ + if((cfg->ykcore_config.extFlags & EXTFLAG_ ## type) == EXTFLAG_ ## type) \ return true; \ else \ return false; \ -- 2.39.5