We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to msdn _read a file with CR-LF line break will cause read size smaller than the file size.
The text was updated successfully, but these errors were encountered:
Thanks @NEUGWB. Do you have a suggestion for a fix?
Sorry, something went wrong.
I think use fopen instead of open, or an fdeof function may help.
bool fdeof(int fd) { char c; int rdsize = read(fd, &c, 1); return rdsize == 0; }
I don't know if there is a better way. :)
my solution is add "O_BINARY", tested ok on VS2017:
char *file_read(const char *path, size_t *len) {
fd = open(path, O_RDONLY | O_BINARY);
Fixed with #365 Had the same problem. Could have just read this instead, would have been a lot easier.
No branches or pull requests
According to msdn _read a file with CR-LF line break will cause read size smaller than the file size.
The text was updated successfully, but these errors were encountered: