From 9542f5218275654ae2923a65b79e2534e730a59c Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 13 Feb 2015 09:39:50 +0000 Subject: [PATCH] InputText: size for allowed input size smaller than necessary by 1 byte. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index c32deddb..cebe2013 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5007,7 +5007,7 @@ static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n) static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len) { const size_t text_len = ImStrlenW(obj->Text); - if ((size_t)new_text_len + text_len + 1 >= obj->BufSize) + if ((size_t)new_text_len + text_len + 1 > obj->BufSize) return false; if (pos != (int)text_len)