Skip to content

Commit

Permalink
ImGuiTextBuffer: Fix size() to allow using ImGuiTextBuffer with resiz…
Browse files Browse the repository at this point in the history
…e(0) patterns.
  • Loading branch information
ocornut committed Feb 5, 2019
1 parent f7c879e commit d93e3c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ struct ImGuiTextBuffer
inline char operator[](int i) { IM_ASSERT(Buf.Data != NULL); return Buf.Data[i]; }
const char* begin() const { return Buf.Data ? &Buf.front() : EmptyString; }
const char* end() const { return Buf.Data ? &Buf.back() : EmptyString; } // Buf is zero-terminated, so end() will point on the zero-terminator
int size() const { return Buf.Data ? Buf.Size - 1 : 0; }
int size() const { return Buf.Size ? Buf.Size - 1 : 0; }
bool empty() { return Buf.Size <= 1; }
void clear() { Buf.clear(); }
void reserve(int capacity) { Buf.reserve(capacity); }
Expand Down

0 comments on commit d93e3c1

Please sign in to comment.