From 45fbaaeb00072d689b9c2ac4b7d109343f30abee Mon Sep 17 00:00:00 2001 From: jon_y Date: Sun, 29 Dec 2024 15:16:42 +0000 Subject: [PATCH] Revert r5469 and r5470, older version of windows may not return a valid value. git-svn-id: svn://scm.orgis.org/mpg123/trunk@5471 35dc7657-300d-0410-a2e5-dc2837fedb53 --- src/win32_support.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/win32_support.c b/src/win32_support.c index 9e402cc5..c8d148e1 100755 --- a/src/win32_support.c +++ b/src/win32_support.c @@ -11,7 +11,7 @@ typedef struct } _startupinfo; /* XP and later has an int return though */ -int __cdecl __declspec(dllimport) __wgetmainargs ( +void __cdecl __declspec(dllimport) __wgetmainargs ( int *_Argc, wchar_t ***_Argv, wchar_t ***_Env, @@ -31,10 +31,7 @@ int win32_cmdline_utf8(int * argc, char *** argv) if(argv == NULL || argc == NULL) return -1; startup.newmode = 0; - if (__wgetmainargs(argc, &argv_wide, &env, 1, &startup) != 0) { - error("Cannot allocate memory for command line."); - return -1; - } + __wgetmainargs(argc, &argv_wide,&env,1, &startup); *argv = (char **)calloc(sizeof (char *), *argc); if(*argv == NULL){ error("Cannot allocate memory for command line."); return -1; }