diff --git a/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/ocornut-imgui/imgui.cpp index 9db3eced5..e77f3db6d 100644 --- a/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/ocornut-imgui/imgui.cpp @@ -5618,8 +5618,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT // From the moment we focused we are ignoring the content of 'buf' ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf); const char* buf_end = NULL; - edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end); - edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. + edit_state.CurLenW = (int)ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end); + edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8. edit_state.Width = w; edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f); edit_state.CursorAnimReset(); diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index 1007787a0..f1cb5dcb9 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -60,15 +60,17 @@ namespace entry switch (_key) { - case Key::Esc: { return 0x1b; } break; - case Key::Return: { return 0x0d; } break; - case Key::Tab: { return 0x09; } break; - case Key::Space: { return 0xa0; } break; - case Key::Backspace: { return 0x08; } break; - case Key::Plus: { return 0x2b; } break; - case Key::Minus: { return 0x2d; } break; - default: { return '\0'; } break; + case Key::Esc: return 0x1b; + case Key::Return: return 0x0d; + case Key::Tab: return 0x09; + case Key::Space: return (char)0xa0; + case Key::Backspace: return 0x08; + case Key::Plus: return 0x2b; + case Key::Minus: return 0x2d; + default: break; } + + return '\0'; } bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv)