summaryrefslogtreecommitdiffstats
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
parent35ddcde3552812ec97bb39c9cfb3fe7a3eee5efd (diff)
Add parenthesis to turn off some cppcheck warnings (code style)
-rw-r--r--src/dir.c18
-rw-r--r--src/ewf.c2
2 files changed, 10 insertions, 10 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)
diff --git a/src/ewf.c b/src/ewf.c
index 195b54f..a157f31 100644
--- a/src/ewf.c
+++ b/src/ewf.c
@@ -270,7 +270,7 @@ disk_t *fewf_init(const char *device, const int mode)
disk->description=fewf_description;
disk->description_short=fewf_description_short;
disk->pread=fewf_pread;
- disk->pwrite=(data->mode&TESTDISK_O_RDWR?fewf_pwrite:fewf_nopwrite);
+ disk->pwrite=((data->mode&TESTDISK_O_RDWR)?fewf_pwrite:fewf_nopwrite);
disk->sync=fewf_sync;
disk->access_mode=(data->mode&TESTDISK_O_RDWR);
disk->clean=fewf_clean;