Fix crash on ErrorOverlay

This commit is contained in:
BernardoGiordano 2019-07-16 21:19:25 +02:00
parent 84fce814a5
commit 09da520fab
3 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ ErrorOverlay::ErrorOverlay(Screen& screen, Result res, const std::string& mtext)
std::string t = StringUtils::wrap(mtext, size, 220);
std::string e = StringUtils::format("Error: 0x%08lX", res);
C2D_TextParse(&text, textBuf, t.c_str());
C2D_TextParse(&text, textBuf, e.c_str());
C2D_TextParse(&error, textBuf, e.c_str());
C2D_TextOptimize(&text);
C2D_TextOptimize(&error);
posx = ceilf(320 - StringUtils::textWidth(text, size)) / 2;

View file

@ -6,7 +6,7 @@ std::u16string KeyboardManager::keyboard(const std::string& suggestion)
char buf[CUSTOM_PATH_LEN] = {0};
SwkbdButton button = swkbdInputText(&mSwkbd, buf, CUSTOM_PATH_LEN);
buf[CUSTOM_PATH_LEN - 1] = '\0';
return button == SWKBD_BUTTON_CONFIRM ? StringUtils::removeForbiddenCharacters(StringUtils::UTF8toUTF16(buf)) : StringUtils::UTF8toUTF16(" ");
return button == SWKBD_BUTTON_CONFIRM ? StringUtils::removeForbiddenCharacters(StringUtils::UTF8toUTF16(buf)) : StringUtils::UTF8toUTF16("");
}
int KeyboardManager::numericPad(void)

View file

@ -170,7 +170,7 @@ std::tuple<bool, Result, std::string> io::backup(size_t index, size_t cellIndex)
}
else {
customPath =
isNewFolder ? StringUtils::removeForbiddenCharacters(KeyboardManager::get().keyboard(suggestion)) : StringUtils::UTF8toUTF16("");
isNewFolder ? KeyboardManager::get().keyboard(suggestion) : StringUtils::UTF8toUTF16("");
}
std::u16string dstPath;