X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=shared%2Fread_file.cpp;h=77a23fdff0b07e181e506c9aa4b6d04357b4d297;hp=40846546b42ed4f11ca055ad9faafcbcaecc418e;hb=9ffd4f03f314cc6e0254449593def95c9bc203d6;hpb=a3b76e5ad9493b0af08fdcbe6d6b689d91496f85 diff --git a/shared/read_file.cpp b/shared/read_file.cpp index 4084654..77a23fd 100644 --- a/shared/read_file.cpp +++ b/shared/read_file.cpp @@ -17,25 +17,25 @@ string read_file(const string &filename, const unsigned char *start, const size_ } perror(filename.c_str()); - exit(1); + abort(); } int ret = fseek(fp, 0, SEEK_END); if (ret == -1) { perror("fseek(SEEK_END)"); - exit(1); + abort(); } int disk_size = ftell(fp); if (disk_size == -1) { perror("ftell"); - exit(1); + abort(); } ret = fseek(fp, 0, SEEK_SET); if (ret == -1) { perror("fseek(SEEK_SET)"); - exit(1); + abort(); } string str; @@ -43,12 +43,12 @@ string read_file(const string &filename, const unsigned char *start, const size_ ret = fread(&str[0], disk_size, 1, fp); if (ret == -1) { perror("fread"); - exit(1); + abort(); } if (ret == 0) { fprintf(stderr, "Short read when trying to read %d bytes from %s\n", disk_size, filename.c_str()); - exit(1); + abort(); } fclose(fp);