diff options
| author | Franklin Wei <git@fwei.tk> | 2015-05-24 14:14:03 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-05-24 14:14:03 -0400 |
| commit | 058c0f9bce6401112f37463cd8d9f10df5c7d004 (patch) | |
| tree | 8f192f6adeaf8bffc2b240ac69b35bb57ee1e828 /src/load.c | |
| parent | 619550ed4aa3e242334153dcc2f003209fff986d (diff) | |
| download | market-sim-058c0f9bce6401112f37463cd8d9f10df5c7d004.zip market-sim-058c0f9bce6401112f37463cd8d9f10df5c7d004.tar.gz market-sim-058c0f9bce6401112f37463cd8d9f10df5c7d004.tar.bz2 market-sim-058c0f9bce6401112f37463cd8d9f10df5c7d004.tar.xz | |
make error messages more uniform
Diffstat (limited to 'src/load.c')
| -rw-r--r-- | src/load.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -6,7 +6,7 @@ static uint32_t cksum; #define ADD_CKSUM(x) (cksum += (x*x) + 1) -#define FAIL() fail("Failed to read from file.") +#define FAIL() fail("Failed to load save: Unexpected end-of-file") uint64_t read_be64(FILE *f) { @@ -122,7 +122,7 @@ void load_portfolio(struct player_t *player, const char *filename) char *sym = malloc(symlen + 1); if(ck_read(sym, symlen + 1, 1, f) != 1) { - fail("Save is corrupted (symbol too short)."); + fail("Failed to load save: Unexpected end-of-file"); } stock->symbol = sym; @@ -166,7 +166,7 @@ void load_portfolio(struct player_t *player, const char *filename) if(ck != cksum) { - fail("Bad checksum, file is corrupt.\nCalculated: %d File: %d", ck, cksum); + fail("Failed to load save: Bad checksum", ck, cksum); } int junk = fgetc(f); |