[PATCH 2/5] winmm: Use wine_dbg_sprintf() in a few debug utility functions.

Henri Verbeet hverbeet at codeweavers.com
Mon Nov 30 03:22:08 CST 2009


---
 dlls/winmm/mci.c   |    5 +----
 dlls/winmm/winmm.c |    4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c
index 49e8598..b8cbdac 100644
--- a/dlls/winmm/mci.c
+++ b/dlls/winmm/mci.c
@@ -151,8 +151,6 @@ static UINT MCI_GetDriverFromString(LPCWSTR lpstrName)
  */
 const char* MCI_MessageToString(UINT wMsg)
 {
-    static char buffer[100];
-
 #define CASE(s) case (s): return #s
 
     switch (wMsg) {
@@ -216,8 +214,7 @@ const char* MCI_MessageToString(UINT wMsg)
 	CASE(MCI_RESTORE);
 #undef CASE
     default:
-	sprintf(buffer, "MCI_<<%04X>>", wMsg);
-	return buffer;
+        return wine_dbg_sprintf("MCI_<<%04X>>", wMsg);
     }
 }
 
diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c
index ef993f2..4f3ace1 100644
--- a/dlls/winmm/winmm.c
+++ b/dlls/winmm/winmm.c
@@ -104,7 +104,6 @@ static	void WINMM_DeleteIData(void)
 const char* WINMM_ErrorToString(MMRESULT error)
 {
 #define ERR_TO_STR(dev) case dev: return #dev
-    static char unknown[32];
     switch (error) {
     ERR_TO_STR(MMSYSERR_NOERROR);
     ERR_TO_STR(MMSYSERR_ERROR);
@@ -132,9 +131,8 @@ const char* WINMM_ErrorToString(MMRESULT error)
     ERR_TO_STR(WAVERR_UNPREPARED);
     ERR_TO_STR(WAVERR_SYNC);
     }
-    sprintf(unknown, "Unknown(0x%08x)", error);
-    return unknown;
 #undef ERR_TO_STR
+    return wine_dbg_sprintf("Unknown(0x%08x)", error);
 }
 
 /**************************************************************************
-- 
1.6.4.4




More information about the wine-patches mailing list