Changeset ed4c556 in rtems


Ignore:
Timestamp:
Nov 20, 2014, 11:25:15 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
502609c8
Parents:
abf3892c
git-author:
Joel Sherrill <joel.sherrill@…> (11/20/14 23:25:15)
git-committer:
Joel Sherrill <joel.sherrill@…> (11/21/14 19:13:22)
Message:

objectsetname.c: Fix always true condition (Coverity ID 1063874)

Coverity spotted the comparison (0 <= length) which is always true.
Changed logic to address this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/objectsetname.c

    rabf3892c red4c556  
    77
    88/*
    9  *  COPYRIGHT (c) 1989-2009.
     9 *  COPYRIGHT (c) 1989-2014.
    1010 *  On-Line Applications Research Corporation (OAR).
    1111 *
     
    5454  {
    5555    the_object->name.name_u32 =  _Objects_Build_name(
    56       ((0 <= length) ? s[ 0 ] : ' '),
    57       ((1 <  length) ? s[ 1 ] : ' '),
    58       ((2 <  length) ? s[ 2 ] : ' '),
    59       ((3 <  length) ? s[ 3 ] : ' ')
     56      ((length)    ? s[ 0 ] : ' '),
     57      ((length > 1) ? s[ 1 ] : ' '),
     58      ((length > 2) ? s[ 2 ] : ' '),
     59      ((length > 3) ? s[ 3 ] : ' ')
    6060    );
    6161
Note: See TracChangeset for help on using the changeset viewer.