Skip to content

Commit

Permalink
Merge remote-tracking branch 'mpg123/master' into master-with-github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mpg123 GitHub bot committed Dec 29, 2024
2 parents 6202036 + 936c178 commit 110d99c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/win32_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ typedef struct
} _startupinfo;

/* XP and later has an int return though */
void __cdecl __declspec(dllimport) __wgetmainargs (
int __cdecl __declspec(dllimport) __wgetmainargs (
int *_Argc,
wchar_t ***_Argv,
wchar_t ***_Env,
Expand All @@ -31,7 +31,10 @@ int win32_cmdline_utf8(int * argc, char *** argv)
if(argv == NULL || argc == NULL) return -1;

startup.newmode = 0;
__wgetmainargs(argc, &argv_wide,&env,1, &startup);
if (__wgetmainargs(argc, &argv_wide, &env, 1, &startup) != 0) {
error("Cannot allocate memory for command line.");
return -1;
}
*argv = (char **)calloc(sizeof (char *), *argc);
if(*argv == NULL){ error("Cannot allocate memory for command line."); return -1; }

Expand Down

0 comments on commit 110d99c

Please sign in to comment.