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

fix(sonar): addressing reliability/security issues (#202)

This commit is contained in:
jerrrrycho
2026-10-04 20:00:13 +02:00
committed by GitHub
parent 51521a135a
commit 79bd0c8e91
36 changed files with 254 additions and 246 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;
}
}