[PATCH] coverity: CID35: fixed wrong condition

Marcus Meissner marcus at jet.franken.de
Mon Feb 5 14:24:27 CST 2007


Hi,

Coverity spotted dead code below (in the while (nRelPos > 0) call.

It is right, with the previous code it would have never been reached.

But both the comments and the rest of the suggests
that it should be nRelPos <= 0 instead of >=.

Ciao, Marcus
---
 dlls/riched20/row.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/row.c b/dlls/riched20/row.c
index 549b3cb..a9acb79 100644
--- a/dlls/riched20/row.c
+++ b/dlls/riched20/row.c
@@ -28,7 +28,7 @@ ME_DisplayItem *ME_FindRowStart(ME_Conte
                                 int nRelPos) {
   ME_DisplayItem *para = ME_GetParagraph(item);
   ME_MustBeWrapped(c, para);
-  if(nRelPos>=0) { /* if this or preceding row */
+  if(nRelPos<=0) { /* if this or preceding row */
     while(nRelPos<=0) {
       ME_DisplayItem *item2 = ME_FindItemBack(item, diStartRowOrParagraph);
       if (item2->type == diParagraph)
-- 
1.4.3.4



More information about the wine-patches mailing list