diff --git a/src/dir.c b/src/dir.c index 587ff529..2694738e 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 195b54fa..a157f310 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;