Skip to content

Commit b25d68f

Browse files
singh264tajilaJasonFengJ9keithc-ca
committed
Address comments
Co-authored-by: Tobi Ajila <[email protected]> Co-authored-by: Jason Feng <[email protected]> Co-authored-by: Keith W. Campbell <[email protected]> Signed-off-by: Amarpreet Singh <[email protected]>
1 parent 92e54cc commit b25d68f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

closed/src/java.base/share/native/libjli/criuhelpers.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ static const char *
3737
getCommandLineOptionValue(const char *optionName, int argc, char **argv, int *error)
3838
{
3939
const char *value = NULL;
40-
int i = 0;
40+
int i = argc - 1;
4141
size_t optionNameLength = strlen(optionName);
4242
jboolean optionNameFound = JNI_FALSE;
4343
*error = 0;
44-
for (i = 0; i < argc; i++) {
44+
for (i = argc - 1; i >= 0; i--) {
4545
const char *arg = argv[i];
4646
if (0 == strncmp(arg, optionName, optionNameLength)) {
4747
const char *equals = arg + optionNameLength;

0 commit comments

Comments
 (0)