Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-02-15 18:37:55 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-02-15 18:37:55 +0300
commita23b70316e6f158aba38348ca6e56f0816231a20 (patch)
tree45e5eeb1d15a7f85e71fb6f1aa72174dc255900e /src/RepRap.cpp
parent7e29692d7519d57e21dbb412db74a202d237a3be (diff)
Corrected recent change to StartIAP
Diffstat (limited to 'src/RepRap.cpp')
-rw-r--r--src/RepRap.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/RepRap.cpp b/src/RepRap.cpp
index a0d942c5..78139b61 100644
--- a/src/RepRap.cpp
+++ b/src/RepRap.cpp
@@ -2826,9 +2826,8 @@ void RepRap::StartIap(const StringRef& filenameRef) noexcept
// Newer versions of IAP reserve space above the stack for us to pass the firmware filename
String<MaxFilenameLength> firmwareFileLocation;
MassStorage::CombineName(firmwareFileLocation.GetRef(), FIRMWARE_DIRECTORY, filenameRef.IsEmpty() ? IAP_FIRMWARE_FILE : filenameRef.c_str());
- const char* filename = firmwareFileLocation.c_str();
const uint32_t topOfStack = *reinterpret_cast<uint32_t *>(IAP_IMAGE_START);
- if (topOfStack + sizeof(filename) <=
+ if (topOfStack + firmwareFileLocation.strlen() + 1 <=
# if SAME5x
HSRAM_ADDR + HSRAM_SIZE
# elif SAM3XA
@@ -2838,7 +2837,7 @@ void RepRap::StartIap(const StringRef& filenameRef) noexcept
# endif
)
{
- strcpy(reinterpret_cast<char*>(topOfStack), filename);
+ strcpy(reinterpret_cast<char*>(topOfStack), firmwareFileLocation.c_str());
}
#endif