Nikolay Sivov : usp10: Use memcpy() to return ScriptLayout() results.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 11 09:59:45 CST 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Feb 10 13:09:44 2016 +0300

usp10: Use memcpy() to return ScriptLayout() results.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/usp10/usp10.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 253177a..3b31867 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -3645,7 +3645,6 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log
     if (!indexs)
         return E_OUTOFMEMORY;
 
-
     if (vistolog)
     {
         for( ich = 0; ich < runs; ich++)
@@ -3654,11 +3653,9 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log
         ich = 0;
         while (ich < runs)
             ich += BIDI_ReorderV2lLevel(0, indexs+ich, level+ich, runs - ich, FALSE);
-        for (ich = 0; ich < runs; ich++)
-            vistolog[ich] = indexs[ich];
+        memcpy(vistolog, indexs, runs * sizeof(*vistolog));
     }
 
-
     if (logtovis)
     {
         for( ich = 0; ich < runs; ich++)
@@ -3667,8 +3664,7 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log
         ich = 0;
         while (ich < runs)
             ich += BIDI_ReorderL2vLevel(0, indexs+ich, level+ich, runs - ich, FALSE);
-        for (ich = 0; ich < runs; ich++)
-            logtovis[ich] = indexs[ich];
+        memcpy(logtovis, indexs, runs * sizeof(*logtovis));
     }
     heap_free(indexs);
 




More information about the wine-cvs mailing list