[PATCH] [WordPad]: don't try to use information that hasn't been initialized yet

Eric Pouech eric.pouech at orange.fr
Sun Mar 23 03:22:51 CDT 2008


(Spotted with Valgrind)

A+
---

 programs/wordpad/wordpad.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index fadb133..cbdecda 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -349,7 +349,7 @@ static void update_font_list(void)
     fmt.cbSize = sizeof(fmt);
 
     SendMessageW(hEditorWnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt);
-    SendMessageW(hFontListEdit, WM_GETTEXT, MAX_PATH, (LPARAM)fontName);
+    if (!SendMessageW(hFontListEdit, WM_GETTEXT, MAX_PATH, (LPARAM)fontName)) return;
 
     if(lstrcmpW(fontName, fmt.szFaceName))
     {





More information about the wine-patches mailing list