From cab8c3b1972d0cabbf19a885e7516d0c63457940 Mon Sep 17 00:00:00 2001 From: Adam Wirth Date: Tue, 22 Apr 2025 20:17:06 -0400 Subject: [PATCH] Update main.cpp Added const qualifier to nSectorSize declaration to resolve compilation issues related to lack of support for variable-length arrays on some systems. --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 42bfbab..76586ff 100644 --- a/main.cpp +++ b/main.cpp @@ -2559,7 +2559,7 @@ bool read_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, UINT uiLen, char *szFile) bool bRet, bFirst = true, bSuccess = false; int iRet; UINT iTotalRead = 0,iRead = 0; - int nSectorSize = 512; + const int nSectorSize = 512; BYTE pBuf[nSectorSize * DEFAULT_RW_LBA]; pComm = new CRKUsbComm(dev, g_pLogObject, bRet); if (bRet) { @@ -2931,7 +2931,7 @@ bool write_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, char *szFile) long long iTotalWrite = 0, iFileSize = 0; UINT iWrite = 0, iRead = 0; UINT uiLen; - int nSectorSize = 512; + const int nSectorSize = 512; BYTE pBuf[nSectorSize * DEFAULT_RW_LBA];