aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-01-30 22:06:51 -0500
committerCara Salter <cara@devcara.com>2022-01-30 22:06:51 -0500
commit7e9317251db9caf4249814140e30ffc7de32274e (patch)
tree3c4175efb45a56b8cfb75ada6ea11185d391ad8d
parent4585ec623286900898a09b1714b3b5de38be4fec (diff)
downloadcmud-7e9317251db9caf4249814140e30ffc7de32274e.tar.gz
cmud-7e9317251db9caf4249814140e30ffc7de32274e.zip
data: Fix bug where player data wasn't written
Function was exiting without freeing the file descriptor or flushing the write buffer to disk. a quick call to fclose fixes this.
-rw-r--r--src/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 3884170..0d43d3c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -76,7 +76,7 @@ int try_write_plr(player_t *plr) {
FILE *fp = fopen(fname, "wb");
fwrite(&plr, sizeof(player_t), 1, fp);
- fsync(fp);
+ fclose(fp);
return err;
}