aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-05-06 00:08:06 -0400
committerJames McCoy <jamessan@jamessan.com>2021-05-06 18:57:22 -0400
commitefed75f91638bc52a2a551683c2f7a1da4a1e3ea (patch)
treec3b0ab80b450b492ae6d2d42da13d9e486842f14
parentd9eaca99bea21829e2396b190409c33fe71bcb40 (diff)
downloadrneovim-efed75f91638bc52a2a551683c2f7a1da4a1e3ea.tar.gz
rneovim-efed75f91638bc52a2a551683c2f7a1da4a1e3ea.tar.bz2
rneovim-efed75f91638bc52a2a551683c2f7a1da4a1e3ea.zip
coverity/331377: os_fopen: Remove invalid iflags assert
If the O_* flags were non-zero, then ORing the flags would always be true. However, the O_* flags aren't guaranteed to be non-zero, so the assert is invalid in the first place.
-rw-r--r--src/nvim/os/fs.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index a3bef3389c..d0fa74a77f 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -471,8 +471,6 @@ FILE *os_fopen(const char *path, const char *flags)
abort();
}
}
- // Per open(2) manpage.
- assert((iflags|O_RDONLY) || (iflags|O_WRONLY) || (iflags|O_RDWR));
// Per fopen(3) manpage: default to 0666, it will be umask-adjusted.
int fd = os_open(path, iflags, 0666);
if (fd < 0) {