X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fread_file.cpp;h=40846546b42ed4f11ca055ad9faafcbcaecc418e;hb=873c8b204ab70622f6e231556cc94d3aab1889ce;hp=2310303dd3345738e0df33710fd72345371d1df1;hpb=eeda8995329601f9f4e35047358400833eeae68e;p=nageru diff --git a/shared/read_file.cpp b/shared/read_file.cpp index 2310303..4084654 100644 --- a/shared/read_file.cpp +++ b/shared/read_file.cpp @@ -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) {