This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: fixed thread names with posix pthreads


It looks like the code is just fine the way it is.  The statement
	name[16] = '\0';
further down NUL terminates the name[] string.  name[] is copied from a
template, which has a fixed length.

Jay

-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Friday, October 21, 2005 8:00 AM
To: Stefan Sommerfeld
Cc: eCos patches
Subject: Re: fixed thread names with posix pthreads


On Fri, 2005-10-21 at 16:32 +0200, Stefan Sommerfeld wrote:
> Hi,
> 
> There was the zero termination missing with the thread name in 
> pthread_create().

Why rewrite the whole loop (and make it more complicated)?
It would be sufficient to just add one line to put in the
termination character.  Just add this line after the for loop:

  name[i] = '\0';

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]