Test invalid module.
authorJay Krell <jaykrell@microsoft.com>
Thu, 29 Aug 2019 18:44:13 +0000 (11:44 -0700)
committerLarry Ewing <lewing@microsoft.com>
Wed, 4 Sep 2019 17:31:13 +0000 (12:31 -0500)
Commit migrated from https://github.com/mono/mono/commit/da2471d0010eff53a63a3a6b852bb4000ce89408

src/mono/mono/eglib/test/module.c

index 5f2d672..94b8340 100644 (file)
@@ -72,9 +72,9 @@ test_module_get_module_filename (void)
 #if _WIN32
        const HMODULE mods [ ] = {NULL, LoadLibraryW (L"msvcrt.dll"), (HMODULE)(gssize)-1 };
 
-       for (int i = 0; i < 2; ++i) {
+       for (int i = 0; i < G_N_ELEMENTS (mods); ++i) {
+               const HMODULE mod = mods [i];
                for (int j = 0; j <= 2; ++j) {
-                       const HMODULE mod = mods [i];
                        wchar_t* str = { 0 };
                        guint32 length = { 0 };
                        wchar_t buf2 [999] = { 0 };