diff options
| author | nyamatongwe <unknown> | 2009-04-22 02:55:17 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2009-04-22 02:55:17 +0000 | 
| commit | ec2c38b2d808c46207aebb0c8642ecc42f641bc5 (patch) | |
| tree | 00e5be800e1848df0b336732ae9997f87c0718a4 /src | |
| parent | 3c79d3dd6c981c8216023724ee41bbb844f115f1 (diff) | |
| download | scintilla-mirror-ec2c38b2d808c46207aebb0c8642ecc42f641bc5.tar.gz | |
Avoid pointing at uninitialized memory as this triggered BoundsChecker.
Diffstat (limited to 'src')
| -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);  		} | 
