summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectgetnameasstring.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-31 16:15:34 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-31 16:15:34 +0000
commit74d0cb441aee70c3bc87032fbac23ea4b7437b8b (patch)
tree167bdb4ddccfb3a3c65b1b590348bde2af8dba0c /cpukit/score/src/objectgetnameasstring.c
parent2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-74d0cb441aee70c3bc87032fbac23ea4b7437b8b.tar.bz2
2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/src/cond.c, posix/src/key.c, posix/src/mqueuenametoid.c, posix/src/mutex.c, posix/src/pbarrier.c, posix/src/prwlock.c, posix/src/pspin.c, posix/src/pthread.c, posix/src/ptimer.c, posix/src/semaphorenametoid.c: Add option for all POSIX objects whether named or unnamed to have a string name. If the API does not directly support having a name, then the user must explicitly assign it using rtems_object_set_name(). * rtems/src/rtemsobjectgetapiclassname.c: Improved testability. * score/include/rtems/score/object.h, score/src/objectgetnameasstring.c, score/src/objectnametoidstring.c, score/src/objectsetname.c: Modifications required to pass testing of recently modified object name operations. Also eliminated multiprocessing related code that was not reachable.
Diffstat (limited to 'cpukit/score/src/objectgetnameasstring.c')
-rw-r--r--cpukit/score/src/objectgetnameasstring.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c
index 71c10370f0..ac70a5035d 100644
--- a/cpukit/score/src/objectgetnameasstring.c
+++ b/cpukit/score/src/objectgetnameasstring.c
@@ -34,7 +34,7 @@ char *_Objects_Get_name_as_string(
char *name
)
{
- Objects_Information *information;
+ Objects_Information *information;
const char *s;
char *d;
uint32_t i;
@@ -77,8 +77,11 @@ char *_Objects_Get_name_as_string(
s = lname;
}
- for ( i=0, d=name ; i<(length-1) && *s ; i++, s++, d++ ) {
- *d = (!isprint(*s)) ? '*' : *s;
+ d = name;
+ if ( s ) {
+ for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
+ *d = (isprint(*s)) ? *s : '*';
+ }
}
*d = '\0';