summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/browserbox.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 919b00fc..96be82e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
2008-04-16 Dennis Friis <peavey@placid.dk>
* src/gui/browserbox.cpp: Fix a basic_string::at sometimes being out
- of range in BrowserBox::draw when checking for line separators.
+ of range in BrowserBox::draw when checking for line separators and
+ color codes.
2008-04-16 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index a2613389..f6c9c51c 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -314,7 +314,8 @@ BrowserBox::draw(gcn::Graphics *graphics)
for (j = 0; j < row.size(); j++)
{
- if (mUseLinksAndUserColors || (!mUseLinksAndUserColors && (j == 0)))
+ if ( (mUseLinksAndUserColors && (j + 3) <= row.size()) ||
+ (!mUseLinksAndUserColors && (j == 0)) )
{
// Check for color change in format "##x", x = [L,P,0..9]
if ((row.at(j) == '#') && (row.at(j + 1) == '#'))