Changeset 6fd4d06f in rtems


Ignore:
Timestamp:
Sep 28, 2009, 11:00:20 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
f55f605
Parents:
af20cd90
Message:

2009-09-28 Joel Sherrill <joel.sherrill@…>

  • score/src/objectidtoname.c: Remove error which cannot be reached since API that calls this checks the error first.
  • score/src/objectsetname.c: Adjust handling of length.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    raf20cd90 r6fd4d06f  
     12009-09-28      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/src/objectidtoname.c: Remove error which cannot be reached
     4        since API that calls this checks the error first.
     5        * score/src/objectsetname.c: Adjust handling of length.
     6
    172009-09-28      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • cpukit/score/src/objectidtoname.c

    raf20cd90 r6fd4d06f  
    2121#include <rtems/score/thread.h>
    2222
    23 /*PAGE
    24  *
     23/*
    2524 *  _Objects_Id_to_name
    2625 *
     
    3534 *
    3635 */
    37 
    38 
    3936Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
    4037  Objects_Id      id,
     
    4946  Objects_Locations    ignored_location;
    5047
    51   if ( !name )
    52     return OBJECTS_INVALID_NAME;
     48  /*
     49   *  Caller is trusted for name != NULL.
     50   */
    5351
    5452  tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
  • cpukit/score/src/objectsetname.c

    raf20cd90 r6fd4d06f  
    3838
    3939  s      = name;
    40   length = strnlen( name, information->name_length ) + 1;
     40  length = strnlen( name, information->name_length );
    4141
    4242#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     
    4444    char *d;
    4545
    46     d = _Workspace_Allocate( length );
     46    d = _Workspace_Allocate( length + 1 );
    4747    if ( !d )
    4848      return false;
     
    5959  {
    6060    the_object->name.name_u32 =  _Objects_Build_name(
    61       ((0<length) ? s[ 0 ] : ' '),
    62       ((1<length) ? s[ 1 ] : ' '),
    63       ((2<length) ? s[ 2 ] : ' '),
    64       ((3<length) ? s[ 3 ] : ' ')
     61      ((0 <= length) ? s[ 0 ] : ' '),
     62      ((1 <  length) ? s[ 1 ] : ' '),
     63      ((2 <  length) ? s[ 2 ] : ' '),
     64      ((3 <  length) ? s[ 3 ] : ' ')
    6565    );
    6666
Note: See TracChangeset for help on using the changeset viewer.