[Lldb-commits] [lldb] r282119 - Fix for loop sign fix in r282112 for column = 0

Ed Maste via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 21 15:36:51 PDT 2016


Author: emaste
Date: Wed Sep 21 17:36:51 2016
New Revision: 282119

URL: http://llvm.org/viewvc/llvm-project?rev=282119&view=rev
Log:
Fix for loop sign fix in r282112 for column = 0

Modified:
    lldb/trunk/source/Core/SourceManager.cpp

Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=282119&r1=282118&r2=282119&view=diff
==============================================================================
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Wed Sep 21 17:36:51 2016
@@ -172,7 +172,7 @@ size_t SourceManager::DisplaySourceLines
         m_last_file_sp->GetLine(line, src_line);
         return_value += s->Printf("    \t");
         // Insert a space for every non-tab character in the source line.
-        for (size_t i = 0; i < column - 1 && i < src_line.length(); ++i)
+        for (size_t i = 0; i + 1 < column && i < src_line.length(); ++i)
           return_value += s->PutChar(src_line[i] == '\t' ? '\t' : ' ');
         // Now add the caret.
         return_value += s->Printf("^\n");




More information about the lldb-commits mailing list