diff options
author | nyamatongwe <devnull@localhost> | 2009-04-22 02:55:17 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-04-22 02:55:17 +0000 |
commit | d6c9b390a51a0d861bf2d3e5b399fc8fd77f18b4 (patch) | |
tree | 00e5be800e1848df0b336732ae9997f87c0718a4 | |
parent | c02eba68a306275e5a91b75b50023b230b87c3aa (diff) | |
download | scintilla-mirror-d6c9b390a51a0d861bf2d3e5b399fc8fd77f18b4.tar.gz |
Avoid pointing at uninitialized memory as this triggered BoundsChecker.
-rw-r--r-- | src/Editor.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 580e2baa3..3e8cb21fc 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1515,15 +1515,15 @@ static int WidthStyledText(Surface *surface, ViewStyle &vs, int styleOffset, } static int WidestLineWidth(Surface *surface, ViewStyle &vs, int styleOffset, const StyledText &st) { - const char *styles = st.styles; + size_t styleStart = 0; LineEnumerator le(st.text, st.length); int widthMax = 0; while (!le.Finished()) { LineSegment ls = le.Next(); int widthSubLine; if (st.multipleStyles) { - widthSubLine = WidthStyledText(surface, vs, styleOffset, ls.s, styles, ls.len); - styles += ls.len + 1; + widthSubLine = WidthStyledText(surface, vs, styleOffset, ls.s, st.styles + styleStart, ls.len); + styleStart += ls.len + 1; } else { widthSubLine = surface->WidthText(vs.styles[styleOffset + st.style].font, ls.s, ls.len); } |