mirror of https://github.com/stella-emu/stella.git
Fix potential uninitialized array access.
This commit is contained in:
parent
91417312f1
commit
4ba7bfde71
|
@ -152,11 +152,11 @@ bool FSNodeWINDOWS::getChildren(AbstractFSList& myList, ListMode mode) const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Drives enumeration
|
// Drives enumeration
|
||||||
TCHAR drive_buffer[100];
|
static std::array<TCHAR, 100> drive_buffer;
|
||||||
GetLogicalDriveStrings(sizeof(drive_buffer) / sizeof(TCHAR), drive_buffer);
|
GetLogicalDriveStrings(static_cast<DWORD>(drive_buffer.size()), drive_buffer.data());
|
||||||
|
|
||||||
char drive_name[2] = { '\0', '\0' };
|
static char drive_name[2] = { '\0', '\0' };
|
||||||
for (TCHAR *current_drive = drive_buffer; *current_drive;
|
for (TCHAR* current_drive = drive_buffer.data(); *current_drive;
|
||||||
current_drive += _tcslen(current_drive) + 1)
|
current_drive += _tcslen(current_drive) + 1)
|
||||||
{
|
{
|
||||||
FSNodeWINDOWS entry;
|
FSNodeWINDOWS entry;
|
||||||
|
|
Loading…
Reference in New Issue