[16/18] gdiplus: allow null-terminated strings in GdipDrawString

Evan Stade estade at gmail.com
Tue Aug 14 21:01:07 CDT 2007


Hi,

If the passed length is -1 then the string is assumed to be null terminated.

 dlls/gdiplus/graphics.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 275cc6c..f3d40ae 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1296,6 +1296,12 @@ GpStatus WINGDIPAPI GdipDrawString(GpGra
         return NotImplemented;
     }
 
+    if(length == -1){
+        length = 0;
+        while(string[length])
+            length++;
+    }
+
     stringdup = GdipAlloc(length * sizeof(WCHAR));
     if(!stringdup) return OutOfMemory;
 
-- 
1.4.1


More information about the wine-patches mailing list