Remove unsave usage of strncpy.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42455 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen
2011-07-19 20:54:21 +00:00
parent d3d53515a9
commit 6cb28af8fd
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -55,7 +55,7 @@ GameProducer::GameProducer(GameSoundBuffer* object,
fPreferredFormat.u.raw_audio.channel_count = format->channel_count;
fPreferredFormat.u.raw_audio.frame_rate = format->frame_rate; // measured in Hertz
fPreferredFormat.u.raw_audio.byte_order = format->byte_order;
// fPreferredFormat.u.raw_audio.channel_mask = B_CHANNEL_LEFT & B_CHANNEL_RIGHT;
// fPreferredFormat.u.raw_audio.channel_mask = B_CHANNEL_LEFT | B_CHANNEL_RIGHT;
// fPreferredFormat.u.raw_audio.valid_bits = 32;
// fPreferredFormat.u.raw_audio.matrix_mask = B_MATRIX_AMBISONIC_WXYZ;
@@ -186,7 +186,7 @@ GameProducer::PrepareToConnect(const media_source& what, const media_destination
fOutput.destination = where;
fOutput.format = *format;
*out_source = fOutput.source;
strncpy(out_name, fOutput.name, B_MEDIA_NAME_LENGTH);
strlcpy(out_name, fOutput.name, B_MEDIA_NAME_LENGTH);
return B_OK;
}
@@ -207,7 +207,7 @@ GameProducer::Connect(status_t error, const media_source& source, const media_de
// that we agreed on, and report our connection name again.
fOutput.destination = destination;
fOutput.format = format;
strncpy(io_name, fOutput.name, B_MEDIA_NAME_LENGTH);
strlcpy(io_name, fOutput.name, B_MEDIA_NAME_LENGTH);
// Now that we're connected, we can determine our downstream latency.
// Do so, then make sure we get our events early enough.
@@ -393,7 +393,7 @@ GameProducer::NodeRegistered()
fOutput.source.port = ControlPort();
fOutput.source.id = 0;
fOutput.node = Node();
::strcpy(fOutput.name, "GameProducer Output");
strlcpy(fOutput.name, "GameProducer Output", B_MEDIA_NAME_LENGTH);
}
+2 -2
View File
@@ -844,9 +844,9 @@ BWindowScreen::_GetCardInfo()
fCardInfo.height = mode.virtual_height;
if (mode.space & 0x10)
strncpy(fCardInfo.rgba_order, "rgba", 4);
memcpy(fCardInfo.rgba_order, "rgba", 4);
else
strncpy(fCardInfo.rgba_order, "bgra", 4);
memcpy(fCardInfo.rgba_order, "bgra", 4);
fCardInfo.flags = 0;
if (mode.flags & B_SCROLL)