From a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Oct 2017 11:27:44 +0200 Subject: [SERVER] Fix types or add explicit casts everywhere we might have type conversion problems --- src/server/rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/rpc.c') diff --git a/src/server/rpc.c b/src/server/rpc.c index 7f57b0a..7b558ce 100644 --- a/src/server/rpc.c +++ b/src/server/rpc.c @@ -250,7 +250,7 @@ static void addacl(int argc, char **argv, void *data UNUSED) } } memcpy( aclRules[aclCount].host, host.addr, 16 ); - aclRules[aclCount].bytes = bits / 8; + aclRules[aclCount].bytes = (int)( bits / 8 ); aclRules[aclCount].bitMask = 0; aclRules[aclCount].permissions = mask; bits %= 8; @@ -258,7 +258,7 @@ static void addacl(int argc, char **argv, void *data UNUSED) for (long int i = 0; i < bits; ++i) { aclRules[aclCount].bitMask = ( aclRules[aclCount].bitMask >> 1 ) | 0x80; } - aclRules[aclCount].host[aclRules[aclCount].bytes] &= aclRules[aclCount].bitMask; + aclRules[aclCount].host[aclRules[aclCount].bytes] &= (uint8_t)aclRules[aclCount].bitMask; } // We now have .bytes set to the number of bytes to memcmp. // In case we have an odd bitmask, .bitMask will be != 0, so when comparing, -- cgit v1.2.3-55-g7522