From 1881cbe860f900d3eceb9694c67a3197be301f50 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 24 Feb 2016 22:43:17 +0100 Subject: [PATCH] TextUnformatted: Fixed rare crash bug with large blurb of text (2k+) not finishing with a '\n' and fully above the clipping Y line. (#535) --- imgui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 8617a682..5f54691e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5076,6 +5076,8 @@ void ImGui::TextUnformatted(const char* text, const char* text_end) while (line < text_end && lines_skipped < lines_skippable) { const char* line_end = strchr(line, '\n'); + if (!line_end) + line_end = text_end; line = line_end + 1; lines_skipped++; }