idf_exe: fix NULL pointer passed to WriteFile

For an unknown reason, passing NULL pointer instead of &written worked
on Windows 10 and on Windows 7 when stdout is not redirected.

Closes https://github.com/espressif/esp-idf/issues/3740
This commit is contained in:
Ivan Grokhotkov 2019-07-09 14:10:00 +02:00
parent 896d675248
commit 76dc87e9ad

View file

@ -48,7 +48,8 @@ int main(int argc, LPTSTR argv[])
(StrCmp(argv[1], TEXT("--version")) == 0 ||
StrCmp(argv[1], TEXT("-v")) == 0)) {
LPCSTR msg = VERSION "\n";
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msg, lstrlen(msg), NULL, NULL);
DWORD written;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msg, lstrlen(msg), &written, NULL);
return 0;
}