richedit: Fix assignment to wrong variable. (LLVM/Clang)

Dylan Smith dylan.ah.smith at gmail.com
Mon May 24 15:13:55 CDT 2010


A dead assignment to variable j was supposed to be used in the following
line.  In addition the index to start searching for the end of a word at
should have been from the end of the run, instead of the initial index
which was for a place in another run.

This can be tested in wordpad with a long line that is wrapped on a series
of whitespace if the series of whitespace is split up by having one of the
middle whitespace characters be in a different character format (e.g.
bold). Likely a rarely used corner case.
---
 dlls/riched20/wrap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c
index 790c280..8d75b7f 100644
--- a/dlls/riched20/wrap.c
+++ b/dlls/riched20/wrap.c
@@ -232,7 +232,8 @@ static ME_DisplayItem *ME_MaximizeSplit(ME_WrapContext *wc, ME_DisplayItem *p, i
       }
       if (piter->member.run.nFlags & MERF_ENDWHITE)
       {
-        j = ME_ReverseFindNonWhitespaceV(piter->member.run.strText, i);
+        i = ME_ReverseFindNonWhitespaceV(piter->member.run.strText,
+                                         piter->member.run.strText->nLen);
         pp = ME_SplitRun(wc, piter, i);
         wc->pt = pp->member.run.pt;
         return pp;
-- 
1.7.0.4



More information about the wine-patches mailing list