PATCH: safearray, missing sizeof

Marcus Meissner marcus at jet.franken.de
Wed Dec 31 08:17:08 CST 2003


Hi,

Stupid bug, size is not just the number of cells, but * elementsize.

Ciao, Marcus

Changelog:
	fixed size calculation on redim if old size was 0.

Index: safearray.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/safearray.c,v
retrieving revision 1.30
diff -u -r1.30 safearray.c
--- dlls/oleaut32/safearray.c	30 Dec 2003 19:06:41 -0000	1.30
+++ dlls/oleaut32/safearray.c	31 Dec 2003 14:15:06 -0000
@@ -1463,7 +1466,7 @@
       else {
 	int oldelems = oldBounds->cElements;
 	oldBounds->cElements = psabound->cElements;
-        ulNewSize = SAFEARRAY_GetCellCount(psa);
+        ulNewSize = SAFEARRAY_GetCellCount(psa) * psa->cbElements;
 	oldBounds->cElements = oldelems;
       }
 
-- 



More information about the wine-patches mailing list