diff --git a/include/menu/TitleOptionsState.h b/include/menu/TitleOptionsState.h index 4cda252..082c60c 100644 --- a/include/menu/TitleOptionsState.h +++ b/include/menu/TitleOptionsState.h @@ -43,4 +43,8 @@ class TitleOptionsState : public ApplicationState { int titleCount; bool isWiiUTitle; + + uint8_t slot = 0; + int cursorPos = 0; + int entrycount; }; \ No newline at end of file diff --git a/src/date.cpp b/src/date.cpp index 0e6f798..ea369ea 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -15,13 +15,12 @@ std::string Date::get() { data[len] = '\0'; fclose(f); - json_t *root; json_error_t error; - - root = json_loads(data, 0, &error); + json_t *root = json_loads(data, 0, &error); if (root) { - std::string buf(json_string_value(json_object_get(root, "Date"))); + std::string buf; + buf.assign(json_string_value(json_object_get(root, "Date"))); json_decref(root); free(data); diff --git a/src/menu/TitleOptionsState.cpp b/src/menu/TitleOptionsState.cpp index 327862d..f7a1850 100644 --- a/src/menu/TitleOptionsState.cpp +++ b/src/menu/TitleOptionsState.cpp @@ -4,10 +4,6 @@ #include #include -static int cursorPos = 0; -static int entrycount; -static uint8_t slot = 0; - void TitleOptionsState::render() { this->isWiiUTitle = (this->title.highID == 0x00050000) || (this->title.highID == 0x00050002); entrycount = 3; @@ -347,25 +343,25 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { case backup: backupSavedata(&this->title, slot, allusers, common); DrawUtils::setRedraw(true); - return SUBSTATE_RETURN; + break; case restore: restoreSavedata(&this->title, slot, sdusers, allusers, common); DrawUtils::setRedraw(true); - return SUBSTATE_RETURN; + break; case wipe: wipeSavedata(&this->title, allusers, common); DrawUtils::setRedraw(true); - return SUBSTATE_RETURN; + break; case copytoOtherDevice: for (int i = 0; i < this->titleCount; i++) { if (titles[i].listID == this->title.dupeID) { copySavedata(&this->title, &titles[i], allusers, allusers_d, common); DrawUtils::setRedraw(true); - return SUBSTATE_RETURN; + break; } } DrawUtils::setRedraw(true); - return SUBSTATE_RETURN; + break; } } return SUBSTATE_RUNNING;