mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] Fix EditorController: cannot use strcpy when the first char is a
flag that can be 0
This commit is contained in:
committed by
LeaNumworks
parent
3677b2f1d0
commit
625c0acd8b
@@ -22,7 +22,8 @@ void EditorController::setScript(Script script) {
|
||||
Script::Data scriptData = m_script.value();
|
||||
size_t availableScriptSize = scriptData.size + Ion::Storage::sharedStorage()->availableSize();
|
||||
assert(sizeof(m_areaBuffer) >= availableScriptSize);
|
||||
strlcpy(m_areaBuffer, (const char *)scriptData.buffer, scriptData.size);
|
||||
// We cannot use strlcpy as the first char reprensenting the importation status can be 0.
|
||||
memcpy(m_areaBuffer, (const char *)scriptData.buffer, scriptData.size);
|
||||
m_editorView.setText(m_areaBuffer+1, availableScriptSize-1); // 1 char is taken by the importation status flag
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user