Closed lucasart closed 3 years ago
Thanks for pointing out, I didn't notice it at all. It should be _O_WRONLY
.
I guess the reason it runs with no problem is that value of _O_RDONLY
constant equals 0
, so it actually becomes _O_TEXT
in this case, which is a valid flag to the API.
In fact, I found that _open_osfhandle
in windows CRT doesn't care about _O_RDONLY
or _O_WRONLY
at all, mentioned here... (not even documented in MSDN 😢)
thanks.
Is this a copy/paste mistake, or am I missing something ? https://github.com/nkg114mc/c-gomoku-cli/blob/main/src/engine.cpp#L180