From 05b8aeb5525d60052c54786e23d59fac1439b058 Mon Sep 17 00:00:00 2001 From: Anders Date: Tue, 28 Sep 2021 01:03:29 +0200 Subject: [PATCH] Loop counter should be the same type as the count type. (#987) It is unlikely that somebody selects more than 0xffff files but just in case, don't loop forever. --- ShellExtension/ShellExtension/WinMergeShell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellExtension/ShellExtension/WinMergeShell.cpp b/ShellExtension/ShellExtension/WinMergeShell.cpp index c2471f219f1..648c1a02015 100644 --- a/ShellExtension/ShellExtension/WinMergeShell.cpp +++ b/ShellExtension/ShellExtension/WinMergeShell.cpp @@ -185,7 +185,7 @@ HRESULT CWinMergeShell::Initialize(LPCITEMIDLIST pidlFolder, hr = S_OK; // Get all file names. - for (WORD x = 0 ; x < uNumFilesDropped; x++) + for (UINT x = 0 ; x < uNumFilesDropped; x++) { // Get the number of bytes required by the file's full pathname UINT wPathnameSize = DragQueryFile(hDropInfo, x, NULL, 0);