-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle very large -f files by rejecting them.
_read(), on Windows, has a 32-bit size argument and a 32-bit return value, so reject -f files that have more than 2^31-1 characters. Add some #defines so that, on Windows, we use _fstati64 to get the size of that file, to handle large files. Don't assume that our definition for ssize_t is the same size as size_t; by the time we want to print the return value of the read, we know it'll fit into an int, so just cast it to int and print it with %d.
- Loading branch information
Showing
2 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters