]> git.sesse.net Git - nageru/commitdiff
Fix another Coverity Scan issue that really should not happen in practice.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 21 Dec 2018 18:14:01 +0000 (19:14 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 21 Dec 2018 18:14:06 +0000 (19:14 +0100)
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) {