From cc34d8a3ecbd477e43b6b0caac570e641195eb50 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 29 Oct 2006 23:19:47 +0000 Subject: Fix infinite loop when GetColumn called with position beyond end of text. --- src/Document.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index fee76840d..e530b0423 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -684,6 +684,8 @@ int Document::GetColumn(int pos) { return column; } else if (ch == '\n') { return column; + } else if (i >= Length()) { + return column; } else { column++; i = MovePositionOutsideChar(i + 1, 1); -- cgit v1.2.3