fix: Trailing zero at end of string input buffers
This commit is contained in:
parent
483ba95d80
commit
39da62532b
@ -559,16 +559,10 @@ namespace ImGui {
|
||||
}
|
||||
|
||||
bool InputText(const char *label, std::string &buffer, ImGuiInputTextFlags flags) {
|
||||
if (buffer.empty())
|
||||
buffer.resize(1, 0x00);
|
||||
|
||||
return ImGui::InputText(label, buffer.data(), buffer.size(), ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
|
||||
}
|
||||
|
||||
bool InputTextMultiline(const char *label, std::string &buffer, const ImVec2 &size, ImGuiInputTextFlags flags) {
|
||||
if (buffer.empty())
|
||||
buffer.resize(1, 0x00);
|
||||
|
||||
return ImGui::InputTextMultiline(label, buffer.data(), buffer.size(), size, ImGuiInputTextFlags_CallbackResize | flags, ImGui::UpdateStringSizeCallback, &buffer);
|
||||
}
|
||||
|
||||
|
@ -131,13 +131,7 @@ namespace hex::plugin::builtin {
|
||||
void drawMathEvaluator() {
|
||||
static std::vector<long double> mathHistory;
|
||||
static std::string lastMathError;
|
||||
static auto mathInput = [] {
|
||||
std::string s;
|
||||
s.reserve(0xFFFF);
|
||||
std::memset(s.data(), 0x00, s.capacity());
|
||||
|
||||
return s;
|
||||
}();
|
||||
static std::string mathInput;
|
||||
bool evaluate = false;
|
||||
|
||||
static MathEvaluator mathEvaluator = [&] {
|
||||
|
Loading…
x
Reference in New Issue
Block a user