Followed Marcus' suggestion and use strlcpy() instead of strncpy() for Haiku.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24637 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-03-29 11:19:27 +00:00
parent 083b91d4ba
commit 4aef1c02ea
1 changed files with 8 additions and 0 deletions

View File

@ -769,7 +769,11 @@ MultiAudioNode::PrepareToConnect(const media_source& what,
channel->fOutput.format = *format;
*source = channel->fOutput.source;
#ifdef __HAIKU__
strlcpy(name, channel->fOutput.name, B_MEDIA_NAME_LENGTH);
#else
strncpy(name, channel->fOutput.name, B_MEDIA_NAME_LENGTH);
#endif
return B_OK;
}
@ -801,7 +805,11 @@ MultiAudioNode::Connect(status_t error, const media_source& source,
// format that we agreed on, and report our connection name again.
channel->fOutput.destination = destination;
channel->fOutput.format = format;
#ifdef __HAIKU__
strlcpy(name, channel->fOutput.name, B_MEDIA_NAME_LENGTH);
#else
strncpy(name, channel->fOutput.name, B_MEDIA_NAME_LENGTH);
#endif
// reset our buffer duration, etc. to avoid later calculations
bigtime_t duration = channel->fOutput.format.u.raw_audio.buffer_size * 10000