Alexandre Julliard : user32/tests: Avoid snprintf, it's broken on Mingw.

Alexandre Julliard julliard at winehq.org
Tue Mar 10 10:53:14 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar  9 17:49:56 2009 +0100

user32/tests: Avoid snprintf, it's broken on Mingw.

---

 dlls/user32/tests/msg.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 3a20cba..3c9a1f4 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -1776,13 +1776,13 @@ static void add_message_(int line, const struct recvd_message *msg)
             };
             const char *code_name = (msg->message <= HCBT_SETFOCUS) ? CBT_code_name[msg->message] : "Unknown";
 
-            snprintf( seq->output, sizeof(seq->output), "%s: hook %d (%s) wp %08lx lp %08lx",
-                      msg->descr, msg->message, code_name, msg->wParam, msg->lParam );
+            sprintf( seq->output, "%s: hook %d (%s) wp %08lx lp %08lx",
+                     msg->descr, msg->message, code_name, msg->wParam, msg->lParam );
         }
         else if (msg->flags & winevent_hook)
         {
-            snprintf( seq->output, sizeof(seq->output), "%s: winevent %p %08x %08lx %08lx",
-                      msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
+            sprintf( seq->output, "%s: winevent %p %08x %08lx %08lx",
+                     msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
         }
         else
         {
@@ -1793,8 +1793,7 @@ static void add_message_(int line, const struct recvd_message *msg)
             {
                 WINDOWPOS *winpos = (WINDOWPOS *)msg->lParam;
 
-                snprintf( seq->output, sizeof(seq->output),
-                          "%s: %p WM_WINDOWPOS%s wp %08lx lp %08lx after %p x %d y %d cx %d cy %d flags %s",
+                sprintf( seq->output, "%s: %p WM_WINDOWPOS%s wp %08lx lp %08lx after %p x %d y %d cx %d cy %d flags %s",
                           msg->descr, msg->hwnd,
                           (msg->message == WM_WINDOWPOSCHANGING) ? "CHANGING" : "CHANGED",
                           msg->wParam, msg->lParam, winpos->hwndInsertAfter,
@@ -1815,10 +1814,9 @@ static void add_message_(int line, const struct recvd_message *msg)
                 DRAW_ITEM_STRUCT di;
                 DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)msg->lParam;
 
-                snprintf( seq->output, sizeof(seq->output),
-                          "%s: %p WM_DRAWITEM: type %x, ctl_id %x, item_id %x, action %x, state %x",
-                          msg->descr, msg->hwnd, dis->CtlType, dis->CtlID,
-                          dis->itemID, dis->itemAction, dis->itemState);
+                sprintf( seq->output, "%s: %p WM_DRAWITEM: type %x, ctl_id %x, item_id %x, action %x, state %x",
+                         msg->descr, msg->hwnd, dis->CtlType, dis->CtlID,
+                         dis->itemID, dis->itemAction, dis->itemState);
 
                 di.u.lp = 0;
                 di.u.item.type = dis->CtlType;
@@ -1832,8 +1830,8 @@ static void add_message_(int line, const struct recvd_message *msg)
             }
             default:
                 if (msg->message >= 0xc000) return;  /* ignore registered messages */
-                snprintf( seq->output, sizeof(seq->output), "%s: %p %04x wp %08lx lp %08lx",
-                          msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
+                sprintf( seq->output, "%s: %p %04x wp %08lx lp %08lx",
+                         msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
             }
         }
     }




More information about the wine-cvs mailing list