17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-19 02:39:19 +02:00

fix(sonar): addressing reliability/security issues

This commit is contained in:
jerrrrycho
2026-10-03 20:21:28 +02:00
parent 51521a135a
commit d88fa5d8e2
32 changed files with 189 additions and 162 deletions

View File

@@ -563,15 +563,12 @@ openal_renderer::init_caps() {
if( ::alcIsExtensionPresent( nullptr, "ALC_ENUMERATION_EXT" ) == AL_TRUE ) {
// enumeration supported
WriteLog( "available audio devices:" );
auto const *devices { ::alcGetString( nullptr, ALC_DEVICE_SPECIFIER ) };
auto const
*device { devices },
*next { devices + 1 };
while( device && *device != '\0' && next && *next != '\0' ) {
WriteLog( { device } );
auto const len { std::strlen( device ) };
device += len + 1;
next += len + 2;
// device list is a sequence of null-terminated names, ending with an empty name
auto const *device { ::alcGetString( nullptr, ALC_DEVICE_SPECIFIER ) };
while( device != nullptr && *device != '\0' ) {
std::string const devicename { device };
WriteLog( devicename );
device += devicename.size() + 1;
}
}