wordpad: Only read up to the maximum number of recent files from the menu.

Huw Davies huw at codeweavers.com
Fri Sep 23 06:01:28 CDT 2016


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 programs/wordpad/registry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/wordpad/registry.c b/programs/wordpad/registry.c
index 6f7f14b..1381116 100644
--- a/programs/wordpad/registry.c
+++ b/programs/wordpad/registry.c
@@ -283,7 +283,7 @@ void registry_set_filelist(LPCWSTR newFile, HWND hMainWnd)
         for(i = 0; i < FILELIST_ENTRIES; i++)
             pFiles[i] = NULL;
 
-        for(i = 0; GetMenuItemInfoW(hMenu, ID_FILE_RECENT1+i, FALSE, &mi); i++)
+        for(i = 0; i < FILELIST_ENTRIES && GetMenuItemInfoW(hMenu, ID_FILE_RECENT1+i, FALSE, &mi); i++)
             pFiles[i] = (LPWSTR)mi.dwItemData;
 
         if(lstrcmpiW(newFile, pFiles[0]))
-- 
2.8.2




More information about the wine-patches mailing list