Gerald Pfeifer : user.exe16: Fix ADD_TO_T macro.

Alexandre Julliard julliard at winehq.org
Mon Jul 10 15:52:46 CDT 2017


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

Author: Gerald Pfeifer <gerald at pfeifer.com>
Date:   Mon Jul 10 01:06:15 2017 +0800

user.exe16: Fix ADD_TO_T macro.

Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user.exe16/user.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c
index 267714a..35f2585 100644
--- a/dlls/user.exe16/user.c
+++ b/dlls/user.exe16/user.c
@@ -3179,12 +3179,14 @@ DWORD WINAPI FormatMessage16(
     talloced= 100;
 
 #define ADD_TO_T(c) \
-        *t++=c;\
-        if (t-target == talloced) {\
+        do { \
+            *t++=c;\
+            if (t-target == talloced) {\
                 target  = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
                 t       = target+talloced;\
                 talloced*=2;\
-        }
+            } \
+        } while(0)
 
     if (from) {
         f=from;




More information about the wine-cvs mailing list