mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
fix: Trailing zero at end of string input buffers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user