Dylan Smith : richedit: Fixed mistake that didn't cause a bug.

Alexandre Julliard julliard at winehq.org
Fri Jun 27 07:41:49 CDT 2008


Module: wine
Branch: master
Commit: ee6b6f338e57ad3c361a18b03ee1068e1521d1b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ee6b6f338e57ad3c361a18b03ee1068e1521d1b0

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Thu Jun 26 16:17:22 2008 -0400

richedit: Fixed mistake that didn't cause a bug.

The check to see if the dwOutputBuffer is full was performed incorrectly
in RTFPutUnicodeString, however, this mistake was actually harmless
since it would just cause an extra loop that does nothing, then the
check would work properly with the variable fit equal to 0.

---

 dlls/riched20/reader.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index 760adec..f456a09 100644
--- a/dlls/riched20/reader.c
+++ b/dlls/riched20/reader.c
@@ -2667,10 +2667,10 @@ RTFPutUnicodeString(RTF_Info *info, const WCHAR *string, int length)
 
                 memmove(info->OutputBuffer + info->dwOutputCount, string, fit * sizeof(WCHAR));
                 info->dwOutputCount += fit;
-                if (fit == sizeof(info->OutputBuffer) / sizeof(WCHAR) - info->dwOutputCount)
-                        RTFFlushUnicodeOutputBuffer(info);
                 length -= fit;
                 string += fit;
+                if (sizeof(info->OutputBuffer) / sizeof(WCHAR) == info->dwOutputCount)
+                        RTFFlushUnicodeOutputBuffer(info);
         }
 }
 




More information about the wine-cvs mailing list