Fix warning.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Sep 2014 23:08:36 +0000 (00:08 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Sep 2014 23:08:36 +0000 (00:08 +0100)
src/lib/util.cc

index 7d3e1e5104541b30f2258798d873c51d8e5478dd..344a9f97d00d49f539adfcda688799f34322335e 100644 (file)
@@ -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;