aboutsummaryrefslogtreecommitdiff
path: root/src/util/readwritefile.cpp
AgeCommit message (Collapse)Author
2022-07-08refactor: add most of src/util to iwyufanquake
These files change infrequently, and not much header shuffling is required. We don't add everything in src/util/ yet, because IWYU makes some dubious suggestions, which I'm going to follow up with upstream.
2022-02-19util: Fix ReadBinaryFile reading beyond maxsizeklementtan
2021-03-01util: fix WriteBinaryFile() claiming success even if error occurredVasil Dimov
`fclose()` is flushing any buffered data to disk, so if it fails then that could mean that the data was not completely written to disk. Thus, check if `fclose()` succeeds and only then claim success from `WriteBinaryFile()`.
2021-03-01util: fix ReadBinaryFile() returning partial contentsVasil Dimov
If an error occurs and `fread()` returns `0` (nothing was read) then the code before this patch would have returned "success" with a partially read contents of the file.
2021-03-01util: extract {Read,Write}BinaryFile() to its own filesVasil Dimov
Extract `ReadBinaryFile()` and `WriteBinaryFile()` from `torcontrol.cpp` to its own `readwritefile.{h,cpp}` files, so that it can be reused from other modules.