Simplify logic in WineEngGetFontData()

Josh Juran josh at iswifter.net
Fri Sep 9 16:19:12 CDT 2011


If buf is NULL, then cbData is not checked anyway and provides nothing.
Otherwise, len is set to cbData, unless cbData is zero, in which case len
is set to zero.  So always setting len to cbData (when buf is non-null) has
the same effect.

---
This is my first Wine patch.  Share and enjoy.

 dlls/gdi32/freetype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 716a37f..d71b0c5 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6198,7 +6198,7 @@ DWORD WineEngGetFontData(GdiFont *font, DWORD table, DWORD
     if(!FT_IS_SFNT(ft_face))
         return GDI_ERROR;
 
-    if(!buf || !cbData)
+    if(!buf)
         len = 0;
     else
         len = cbData;

-- 
Josh Juran





More information about the wine-patches mailing list