]> git.sesse.net Git - nageru/blobdiff - shared/read_file.cpp
Fix another Coverity Scan issue that really should not happen in practice.
[nageru] / shared / read_file.cpp
index 2310303dd3345738e0df33710fd72345371d1df1..40846546b42ed4f11ca055ad9faafcbcaecc418e 100644 (file)
@@ -27,6 +27,10 @@ string read_file(const string &filename, const unsigned char *start, const size_
        }
 
        int disk_size = ftell(fp);
+       if (disk_size == -1) {
+               perror("ftell");
+               exit(1);
+       }
 
        ret = fseek(fp, 0, SEEK_SET);
        if (ret == -1) {