aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/command.c b/src/command.c
index c118be227..2c307e0bb 100644
--- a/src/command.c
+++ b/src/command.c
@@ -882,8 +882,7 @@ int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength,
while(node != NULL) {
cmd = (CommandEntry *) node->data;
-
- if(*permission || *permission & cmd->reqPermission) {
+ if(cmd->reqPermission == (*permission & cmd->reqPermission)) {
myfprintf(fp, "command: %s\n", cmd->cmd);
}
@@ -902,7 +901,7 @@ int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayLength,
while(node != NULL) {
cmd = (CommandEntry *) node->data;
- if(!(*permission || *permission & cmd->reqPermission)) {
+ if(cmd->reqPermission != (*permission & cmd->reqPermission)) {
myfprintf(fp, "command: %s\n", cmd->cmd);
}