summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-25 22:25:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-25 22:25:18 +0000
commit4cce3f97c508b4304d1b3901cdbdfeea17cec6d3 (patch)
tree18afcfd43fe55f24983d48ea1a025699a18da8f7 /cpukit/libcsupport
parent2010-08-25 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-4cce3f97c508b4304d1b3901cdbdfeea17cec6d3.tar.bz2
2010-08-25 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 93/NO_EFFECT Coverity Id 94/NO_EFFECT * libcsupport/src/readv.c, libcsupport/src/writev.c: size_t is unsigned so it is useless to check for < 0.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/readv.c9
-rw-r--r--cpukit/libcsupport/src/writev.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/cpukit/libcsupport/src/readv.c b/cpukit/libcsupport/src/readv.c
index 3f97b14f14..6b33760504 100644
--- a/cpukit/libcsupport/src/readv.c
+++ b/cpukit/libcsupport/src/readv.c
@@ -68,10 +68,11 @@ ssize_t readv(
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
ssize_t old;
- if ( !iov[v].iov_base )
- rtems_set_errno_and_return_minus_one( EINVAL );
-
- if ( iov[v].iov_len < 0 )
+ /*
+ * iov[v].iov_len cannot be less than 0 because size_t is unsigned.
+ * So we only check for zero.
+ */
+ if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
diff --git a/cpukit/libcsupport/src/writev.c b/cpukit/libcsupport/src/writev.c
index 8dabe1d598..380e325365 100644
--- a/cpukit/libcsupport/src/writev.c
+++ b/cpukit/libcsupport/src/writev.c
@@ -73,10 +73,11 @@ ssize_t writev(
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
- if ( !iov[v].iov_base )
- rtems_set_errno_and_return_minus_one( EINVAL );
-
- if ( iov[v].iov_len < 0 )
+ /*
+ * iov[v].iov_len cannot be less than 0 because size_t is unsigned.
+ * So we only check for zero.
+ */
+ if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )