Use safe wxStrlcpy() instead of strncpy()
This probably doesn't change much in practice, as it's unlikely that SDL_GetCurrentAudioDriver() returns a 255 character long stting, but is still safer and avoid gcc 8 warnings about passing exactly the buffer size to strncpy().
This commit is contained in:
@@ -215,7 +215,7 @@ bool wxSoundBackendSDL::OpenAudio()
|
|||||||
#if SDL_MAJOR_VERSION == 1
|
#if SDL_MAJOR_VERSION == 1
|
||||||
SDL_AudioDriverName(driver, 256);
|
SDL_AudioDriverName(driver, 256);
|
||||||
#elif SDL_MAJOR_VERSION > 1
|
#elif SDL_MAJOR_VERSION > 1
|
||||||
strncpy(driver, SDL_GetCurrentAudioDriver(), 256);
|
wxStrlcpy(driver, SDL_GetCurrentAudioDriver(), 256);
|
||||||
#endif
|
#endif
|
||||||
wxLogTrace(wxT("sound"), wxT("opened audio, driver '%s'"),
|
wxLogTrace(wxT("sound"), wxT("opened audio, driver '%s'"),
|
||||||
wxString(driver, wxConvLocal).c_str());
|
wxString(driver, wxConvLocal).c_str());
|
||||||
|
Reference in New Issue
Block a user