8173634: libjli/cmdtoargs.c does not compile with VS2010
authorclanger
Mon, 30 Jan 2017 16:33:20 +0100
changeset 43334 c5fb77a8b62a
parent 43333 958f1fb2dfd6
child 43335 911fcebb04d2
8173634: libjli/cmdtoargs.c does not compile with VS2010 Reviewed-by: rriggs
jdk/src/java.base/windows/native/libjli/cmdtoargs.c
--- a/jdk/src/java.base/windows/native/libjli/cmdtoargs.c	Mon Jan 30 13:14:09 2017 +0100
+++ b/jdk/src/java.base/windows/native/libjli/cmdtoargs.c	Mon Jan 30 16:33:20 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -200,7 +200,7 @@
     int nargs = 0;
     StdArg* argv = NULL;
     jboolean wildcard = JNI_FALSE;
-    char* src = cmdline;
+    char* src = cmdline, *arg = NULL;
     JLI_List argsInFile;
     size_t i, cnt;
 
@@ -219,7 +219,7 @@
     argv = JLI_MemAlloc(cnt * sizeof(StdArg));
 
     // allocate arg buffer with sufficient space to receive the largest arg
-    char* arg = JLI_StringDup(cmdline);
+    arg = JLI_StringDup(cmdline);
 
     src = next_arg(src, arg, &wildcard);
     // first argument is the app name, do not preprocess and make sure remains first