]> granicus.if.org Git - graphviz/commitdiff
Fix lefty crash at exit in MSBuild debug build
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Wed, 9 Sep 2020 07:11:33 +0000 (09:11 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 11 Sep 2020 06:01:42 +0000 (08:01 +0200)
Final commit that fixes
https://gitlab.com/graphviz/graphviz/-/issues/1818.

cmd/lefty/lefty.c

index 633d9a20a9cffa2d74665eb7bfa00829be1e9b91..3ca82f298ef0e35d70fdcef674c7b8ae550b9244 100644 (file)
@@ -213,6 +213,8 @@ int APIENTRY WinMain (
 ) {
     Tobj co;
     Psrc_t src;
+    int argc;
+    LPWSTR *argv;
 
     hinstance = hInstance;
     hprevinstance = hPrevInstance;
@@ -231,8 +233,11 @@ int APIENTRY WinMain (
     Eshowcalls = 1;
 
     processstr (leftyoptions);
-    __argv++, __argc--;
-    processargs (__argc, __argv);
+    argv = CommandLineToArgvW(lpCmdLine, &argc);
+    if (argv == NULL)
+      return EXIT_FAILURE;
+    processargs(argc, argv);
+    LocalFree(argv);
 
     if (setjmp (exitljbuf))
         goto eop;