Use enum value as array index.

This commit is contained in:
Gerhard Hoffmann 2023-12-10 14:42:28 +01:00
parent 47f09067ea
commit 5dd90e9597

View File

@ -4387,7 +4387,7 @@ bool hwapi::dcDownloadRequest(QString const &dcFileToDownload) const {
return false;
}
char *fNameBuffer = data->m_downLoadDC.m_filename;
char *fNameBuffer = data->m_downLoadDC.m_filename[(int)SharedMem::DCDownload::FILE_INDEX::DC_BINARY];
size_t const size = sizeof(data->m_downLoadDC.m_filename);
std::memset(fNameBuffer, 0x00, size);
@ -4575,7 +4575,7 @@ bool hwapi::dcDownloadReportFinished() {
QString hwapi::dcDownloadFileName() const {
SharedMem const *data = SharedMem::getDataConst();
return data ? data->m_downLoadDC.m_filename : "";
return data ? data->m_downLoadDC.m_filename[(int)SharedMem::DCDownload::FILE_INDEX::DC_BINARY] : "";
}
bool hwapi::dcDownloadSetRequested(bool requested) {