From 7757615404b1241d087abca2e0ae5fa57bbef157 Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Mon, 30 Aug 2021 16:33:11 -0400 Subject: [PATCH] SWDEV-301289 - Correctly reset optind when using getopt() optind's starting value is 1 and it needs to be reset to 1 after each getopt() invocation. Resetting it to 0 will cause getopt() to reinitialize its internal state. This is only needed for some corner cases. In our current usage, we should be resetting it to 1. Change-Id: I68da7e41ee8b83b275e2a7bd660c13af569769f1 [ROCm/clr commit: 3d82092632b3e7b13724397fa986068054c4e69c] --- projects/clr/opencl/tests/ocltst/env/ocltst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/opencl/tests/ocltst/env/ocltst.cpp b/projects/clr/opencl/tests/ocltst/env/ocltst.cpp index 255f4d4fd7..977d4de4cf 100644 --- a/projects/clr/opencl/tests/ocltst/env/ocltst.cpp +++ b/projects/clr/opencl/tests/ocltst/env/ocltst.cpp @@ -1459,7 +1459,7 @@ int main(int argc, char** argv) { unsigned int platform = 0; platform = parseCommandLineForPlatform(argc, argv); // reset optind as we really didn't parse the full command line - optind = 0; + optind = 1; App app(platform); #ifdef ATI_OS_WIN // this function is registers windows service routine when ocltst is launched