X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwinvlc.c;h=18c1b13b1234e3989db029fc72b63df17ed5ba22;hb=fa81ade13492bab2a809e6c8990e211f04aecab8;hp=492591786e1f7d426e24a2fc1dfa4f55e6501988;hpb=4d50cccae6bd757cfc3db77f515827a8c94dac21;p=vlc diff --git a/src/winvlc.c b/src/winvlc.c index 492591786e..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; @@ -103,15 +103,16 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, argc = parse_cmdline (psz_cmdline, &argv); - libvlc_exception_t ex; + libvlc_exception_t ex, dummy; libvlc_exception_init (&ex); + libvlc_exception_init (&dummy); /* Initialize libvlc */ libvlc_instance_t *vlc = libvlc_new (argc, (const char **)argv, &ex); if (vlc != NULL) { libvlc_add_intf (vlc, NULL, &ex); - libvlc_playlist_play (vlc, -1, 0, NULL, NULL); + libvlc_playlist_play (vlc, -1, 0, NULL, &dummy); libvlc_wait (vlc); libvlc_release (vlc); } @@ -119,6 +120,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ret = libvlc_exception_raised (&ex); libvlc_exception_clear (&ex); + libvlc_exception_clear (&dummy); return ret; } @@ -127,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