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:
parent
896d675248
commit
76dc87e9ad
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue