Bruno Jesus : msvfw32: Make wine_dbgstr_fcc handle non-ASCII values better.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 20 11:28:29 CDT 2015


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

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Tue Oct 20 14:57:12 2015 +0800

msvfw32: Make wine_dbgstr_fcc handle non-ASCII values better.

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvfw32/msvideo_main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c
index 1ebfc00..d0ff270 100644
--- a/dlls/msvfw32/msvideo_main.c
+++ b/dlls/msvfw32/msvideo_main.c
@@ -48,9 +48,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
 
 static inline const char *wine_dbgstr_fcc( DWORD fcc )
 {
-    return wine_dbg_sprintf("%c%c%c%c", 
-                            LOBYTE(LOWORD(fcc)), HIBYTE(LOWORD(fcc)),
-                            LOBYTE(HIWORD(fcc)), HIBYTE(HIWORD(fcc)));
+    char fcc_str[5] = {LOBYTE(LOWORD(fcc)), HIBYTE(LOWORD(fcc)),
+                       LOBYTE(HIWORD(fcc)), HIBYTE(HIWORD(fcc)), '\0'};
+    if (isalnum(fcc_str[0]) && isalnum(fcc_str[1])
+     && isalnum(fcc_str[2]) && isalnum(fcc_str[3]))
+        return wine_dbg_sprintf("%s", fcc_str);
+    return wine_dbg_sprintf("0x%08x", fcc);
 }
 
 static WINE_HIC*        MSVIDEO_FirstHic /* = NULL */;




More information about the wine-cvs mailing list