diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-14 16:31:24 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-14 16:31:24 +0000 |
commit | b1f05f589e4d879c14d3bf4fd294a355862c505a (patch) | |
tree | 187ce420dae76d0490230ba043bfc0fdac96ccb2 /src/blockchain_utilities/blockchain_blackball.cpp | |
parent | Merge pull request #4324 (diff) | |
download | monero-b1f05f589e4d879c14d3bf4fd294a355862c505a.tar.xz |
blockchain_blackball: error out on fgets error
Diffstat (limited to 'src/blockchain_utilities/blockchain_blackball.cpp')
-rw-r--r-- | src/blockchain_utilities/blockchain_blackball.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp index d9a179f64..c80dd5862 100644 --- a/src/blockchain_utilities/blockchain_blackball.cpp +++ b/src/blockchain_utilities/blockchain_blackball.cpp @@ -898,7 +898,11 @@ static std::vector<std::pair<uint64_t, uint64_t>> load_outputs(const std::string while (1) { char s[256]; - fgets(s, sizeof(s), f); + if (!fgets(s, sizeof(s), f)) + { + MERROR("Error reading from " << filename << ": " << strerror(errno)); + break; + } if (feof(f)) break; const size_t len = strlen(s); |