summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-06-23 19:44:38 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-06-23 19:44:38 +0200
commitff35213e531f45d249a306084ab4646cbae0fc06 (patch)
tree8b07efc42002eb7aa4b930567f5043eac7228db9 /src/dir.c
parent35ddcde3552812ec97bb39c9cfb3fe7a3eee5efd (diff)
Add parenthesis to turn off some cppcheck warnings (code style)
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dir.c b/src/dir.c
index 587ff52..2694738 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -107,15 +107,15 @@ static char ftypelet (unsigned int bits)
void mode_string (const unsigned int mode, char *str)
{
str[0] = ftypelet(mode);
- str[1] = mode & LINUX_S_IRUSR ? 'r' : '-';
- str[2] = mode & LINUX_S_IWUSR ? 'w' : '-';
- str[3] = mode & LINUX_S_IXUSR ? 'x' : '-';
- str[4] = mode & LINUX_S_IRGRP ? 'r' : '-';
- str[5] = mode & LINUX_S_IWGRP ? 'w' : '-';
- str[6] = mode & LINUX_S_IXGRP ? 'x' : '-';
- str[7] = mode & LINUX_S_IROTH ? 'r' : '-';
- str[8] = mode & LINUX_S_IWOTH ? 'w' : '-';
- str[9] = mode & LINUX_S_IXOTH ? 'x' : '-';
+ str[1] = (mode & LINUX_S_IRUSR) ? 'r' : '-';
+ str[2] = (mode & LINUX_S_IWUSR) ? 'w' : '-';
+ str[3] = (mode & LINUX_S_IXUSR) ? 'x' : '-';
+ str[4] = (mode & LINUX_S_IRGRP) ? 'r' : '-';
+ str[5] = (mode & LINUX_S_IWGRP) ? 'w' : '-';
+ str[6] = (mode & LINUX_S_IXGRP) ? 'x' : '-';
+ str[7] = (mode & LINUX_S_IROTH) ? 'r' : '-';
+ str[8] = (mode & LINUX_S_IWOTH) ? 'w' : '-';
+ str[9] = (mode & LINUX_S_IXOTH) ? 'x' : '-';
str[10]='\0';
#ifdef LINUX_S_ISUID
if (mode & LINUX_S_ISUID)