Skip to content

Commit

Permalink
Newer runtime __wgetmainargs may return errors as per https://sourcef…
Browse files Browse the repository at this point in the history
…orge.net/p/mpg123/bugs/375/

git-svn-id: svn://scm.orgis.org/mpg123/trunk@5469 35dc7657-300d-0410-a2e5-dc2837fedb53
  • Loading branch information
jon_y committed Dec 29, 2024
1 parent 4a8592b commit 5da6d72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/win32_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 5da6d72

Please sign in to comment.