From ed4c5568c7b7dda50f7374b7e3d79e21c0ad8185 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 20 Nov 2014 17:25:15 -0600 Subject: objectsetname.c: Fix always true condition (Coverity ID 1063874) Coverity spotted the comparison (0 <= length) which is always true. Changed logic to address this. --- cpukit/score/src/objectsetname.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpukit/score/src/objectsetname.c b/cpukit/score/src/objectsetname.c index e405c8ac0c..c699570209 100644 --- a/cpukit/score/src/objectsetname.c +++ b/cpukit/score/src/objectsetname.c @@ -6,7 +6,7 @@ */ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2014. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -53,10 +53,10 @@ bool _Objects_Set_name( #endif { the_object->name.name_u32 = _Objects_Build_name( - ((0 <= length) ? s[ 0 ] : ' '), - ((1 < length) ? s[ 1 ] : ' '), - ((2 < length) ? s[ 2 ] : ' '), - ((3 < length) ? s[ 3 ] : ' ') + ((length) ? s[ 0 ] : ' '), + ((length > 1) ? s[ 1 ] : ' '), + ((length > 2) ? s[ 2 ] : ' '), + ((length > 3) ? s[ 3 ] : ' ') ); } -- cgit v1.2.3