Fix warning about variable length array.

This commit is contained in:
George Zhao
2018-01-17 19:44:04 +08:00
parent 5a594091dc
commit 3632f02564

View File

@@ -229,7 +229,7 @@ int main(int argc, char **argv)
#endif #endif
{ {
#if defined(WIN32) && !defined(MAKE_LIB) #if defined(WIN32) && !defined(MAKE_LIB)
char *argv[argc]; char **argv = xmalloc((size_t)argc * sizeof(char *));
for (int i = 0; i < argc; i++) { for (int i = 0; i < argc; i++) {
char *buf = NULL; char *buf = NULL;
utf16_to_utf8(argv_w[i], &buf); utf16_to_utf8(argv_w[i], &buf);
@@ -571,6 +571,9 @@ int main(int argc, char **argv)
*/ */
normal_enter(false, false); normal_enter(false, false);
#if defined(WIN32) && !defined(MAKE_LIB)
xfree(argv);
#endif
return 0; return 0;
} }