From: Andrew D'Addesio Subject: [PATCH 3/5] ddraw/tests: Restore strings modified by D3D7EnumLifetimeTest Message-Id: <1443981128-23605-3-git-send-email-andrew@fatbag.net> Date: Sun, 4 Oct 2015 12:52:06 -0500 In-Reply-To: <1443981128-23605-1-git-send-email-andrew@fatbag.net> References: <1443981128-23605-1-git-send-email-andrew@fatbag.net> --- dlls/ddraw/tests/d3d.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 2505196..df6b3cf 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -793,10 +793,10 @@ static void D3D7EnumLifetimeTest(void) } /* Try altering the contents of the enumeration strings. */ - for (i = 0; i < ctx2.count; i++) + for (i = 0; i < ctx.count; i++) { - strcpy(ctx2.callback_description_ptrs[i], "Fake Description"); - strcpy(ctx2.callback_name_ptrs[i], "Fake Device"); + strcpy(ctx.callback_description_ptrs[i], "Fake Description"); + strcpy(ctx.callback_name_ptrs[i], "Fake Device"); } ctx2.count = 0; @@ -819,6 +819,13 @@ static void D3D7EnumLifetimeTest(void) "Got '%s' and '%s'\n", ctx.callback_name_strings[i], ctx2.callback_name_strings[i]); } } + + /* Restore the original strings. */ + for (i = 0; i < ctx.count; i++) + { + strcpy(ctx.callback_description_ptrs[i], ctx.callback_description_strings[i]); + strcpy(ctx.callback_name_ptrs[i], ctx.callback_name_strings[i]); + } } static void CapsTest(void) -- 2.4.3