From d3aa2e286a18a58c97893c6c60c924af6f4e190d Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 21 Aug 2013 05:52:44 +0200 Subject: [PATCH 1/1] Cosmetic reformatting of save_game() code. --- src/misc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/misc.c b/src/misc.c index 697c182..9c555c9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -138,8 +138,8 @@ extern void save_game(struct World * world) char * savefile_tmp = "savefile_tmp"; char * savefile = "savefile"; FILE * file = fopen(savefile_tmp, "w"); - exit_err(0 == file, world, "Error saving game: " - "Unable to open new savefile for writing."); + exit_err(0 == file, world, + "Error saving game: Unable to open new savefile for writing."); if ( write_uint32_bigendian(world->seed, file) || write_uint32_bigendian(world->turn, file) || write_uint16_bigendian(world->player->pos.y + 1, file) @@ -148,18 +148,19 @@ extern void save_game(struct World * world) || write_map_objects(world, world->monster, file) || write_map_objects(world, world->item, file)) { - exit_err(1, world, "Error saving game: " - "Trouble writing to opened new savefile."); + exit_err(1, world, + "Error saving game: Trouble writing to opened new savefile."); } - exit_err(fclose(file), world, "Error saving game: " - "Unable to close opened new savefile."); + exit_err(fclose(file), world, + "Error saving game: Unable to close opened new savefile."); if (!access(savefile, F_OK)) { - exit_err(unlink(savefile), world, "Error saving game: " - "Unable to unlink old savefile."); + exit_err(unlink(savefile), world, + "Error saving game: Unable to unlink old savefile."); } - exit_err(rename(savefile_tmp, "savefile"), world, "Error saving game: " - "Unable to rename 'savefile_tmp' to 'savefile'."); + exit_err(rename(savefile_tmp, savefile), world, + "Error saving game: Unable to rename 'savefile_tmp' to " + "'savefile'."); } -- 2.30.2