[apps/code] Fix crashes on full buffer

Change-Id: If9297f1ca29015cad0cc1cdda3ad610fd1493392
This commit is contained in:
Hugo Saint-Vignes
2020-08-13 15:03:06 +02:00
committed by Émilie Feral
parent aba135bc8b
commit d937bc692b
4 changed files with 10 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ void EditorController::setScript(Script script, int scriptIndex) {
m_script = script;
m_scriptIndex = scriptIndex;
/* We edit the script direclty in the storage buffer. We thus put all the
/* We edit the script directly in the storage buffer. We thus put all the
* storage available space at the end of the current edited script and we set
* its size.
*
@@ -36,8 +36,8 @@ void EditorController::setScript(Script script, int scriptIndex) {
*
* */
size_t newScriptSize = Ion::Storage::sharedStorage()->putAvailableSpaceAtEndOfRecord(m_script);
m_editorView.setText(const_cast<char *>(m_script.content()), newScriptSize - Script::StatusSize());
Ion::Storage::sharedStorage()->putAvailableSpaceAtEndOfRecord(m_script);
m_editorView.setText(const_cast<char *>(m_script.content()), m_script.contentSize());
}
void EditorController::willExitApp() {