diff --git a/src/kits/game/GameProducer.cpp b/src/kits/game/GameProducer.cpp index 993eb9ea12..f65fabcca5 100644 --- a/src/kits/game/GameProducer.cpp +++ b/src/kits/game/GameProducer.cpp @@ -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); } diff --git a/src/kits/game/WindowScreen.cpp b/src/kits/game/WindowScreen.cpp index b6ebed418a..38d482b2f4 100644 --- a/src/kits/game/WindowScreen.cpp +++ b/src/kits/game/WindowScreen.cpp @@ -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)