X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwinvlc.c;h=18c1b13b1234e3989db029fc72b63df17ed5ba22;hb=9589813471d0f5525789b7cf7165e48d177cbad6;hp=80f225921ce7b2d9de232a2b7717892a3c3d75ec;hpb=c15a5164ddd9105ce4de09fc9dcd95d4263ad3df;p=vlc diff --git a/src/winvlc.c b/src/winvlc.c index 80f225921c..18c1b13b12 100644 --- a/src/winvlc.c +++ b/src/winvlc.c @@ -91,9 +91,9 @@ static int parse_cmdline (char *line, char ***argvp) * wWinMain: parse command line, start interface and spawn threads. *****************************************************************************/ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPWSTR lpCmdLine, int nCmdShow ) + LPWSTR lpCmdLine, int nCmdShow ) { - char **argv, psz_cmdline[wcslen(lpCmdLine) * 4]; + char **argv, psz_cmdline[wcslen(lpCmdLine) * 4 + 1]; int argc, ret; (void)hInstance; (void)hPrevInstance; (void)nCmdShow; @@ -129,8 +129,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR args, int nCmdShow) { /* This makes little sense, but at least it links properly */ - wchar_t lpCmdLine[strlen(args) * 3]; - MultiByteToWideChar( CP_ACP, 0, args, -1, lpCmdLine, sizeof(lpCmdLine) ); + wchar_t lpCmdLine[(strlen (args) + 1) * 3]; + MultiByteToWideChar (CP_ACP, 0, args, -1, lpCmdLine, sizeof (lpCmdLine)); return wWinMain (hInstance, hPrevInstance, lpCmdLine, nCmdShow); } #endif