diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-09-04 00:08:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-09-04 00:08:36 +0100 |
| commit | a4d3b0b6b1069b08fff0559f63d73bb7353256bd (patch) | |
| tree | e16d54792b830652284c39fcb618fe9c1ecea9ec /src | |
| parent | cb1dfa9ec09af2abf6d10e4bf2764476db83841b (diff) | |
Fix warning.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index 7d3e1e510..344a9f97d 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -472,7 +472,10 @@ md5_digest (vector<boost::filesystem::path> files, shared_ptr<Job> job) while (remaining > 0) { int const t = min (remaining, buffer_size); - fread (buffer, 1, t, f); + int const r = fread (buffer, 1, t, f); + if (r != t) { + throw ReadFileError (files[i], errno); + } digester.add (buffer, t); remaining -= t; |
