xolox/vim-shell — pull request #14 by inkarkat (2013-05-28 07:05:53+00:00)
Title: FIX: Don't return stack-allocated character buffer to Vim.

This fixes #13 for me, but please review; it's been some time since I've seriously written C code, so I'm a bit rusty :-)

Thanks for looking so quickly into the issue I've submitted; I agree that your `sprintf()` change in aac1374 is correct, but that alone didn't change the symptoms of the problem at all. Fortunately, I have a minimal build environment, and I was able to get the DLL working by fiddling with the code, around what you've recently changed there.

The function-local `rv` string is allocated on the stack, that seems to work by pure chance in 32-bit, but fails in 64-bit. A simple fix is to make it a static string.