From 307ed7800665ad3e1dcfca661b69fa10a4d078f3 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 13 Aug 2015 21:48:08 -0600 Subject: [PATCH] ImGuITextBuffer: shallow tweak. --- imgui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.h b/imgui.h index 821e9e348..58686dd93 100644 --- a/imgui.h +++ b/imgui.h @@ -865,8 +865,8 @@ struct ImGuiTextBuffer inline char operator[](int i) { return Buf.Data[i]; } const char* begin() const { return &Buf.front(); } const char* end() const { return &Buf.back(); } // Buf is zero-terminated, so end() will point on the zero-terminator - int size() const { return Buf.Size-1; } - bool empty() { return size() >= 1; } + int size() const { return Buf.Size - 1; } + bool empty() { return Buf.Size >= 2; } void clear() { Buf.clear(); Buf.push_back(0); } IMGUI_API void append(const char* fmt, ...) IM_PRINTFARGS(2); IMGUI_API void appendv(const char* fmt, va_list args);