Skip to content

Commit 4b3d528

Browse files
committed
fix warning: suggest parentheses around '&&' within '||'
src/util.c:225:55: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 225 | if (sigill_error || S_ISREG(statbuf.st_mode) && (__off_t)(base + (off_t)len) > statbuf.st_size ) |
1 parent 163fe6e commit 4b3d528

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void *mem_chunk(Log_t *logp, size_t base, size_t len, const char *devmem)
222222
* mmap() will fail with SIGBUS if trying to map beyond the end of
223223
* the file.
224224
*/
225-
if (sigill_error || S_ISREG(statbuf.st_mode) && (__off_t)(base + (off_t)len) > statbuf.st_size )
225+
if ((sigill_error || S_ISREG(statbuf.st_mode)) && (__off_t)(base + (off_t)len) > statbuf.st_size )
226226
{
227227
log_append(logp, LOGFL_NORMAL, LOG_WARNING,
228228
"mmap: Can't map beyond end of file %s: %s",

0 commit comments

Comments
 (0)