aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/playerdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r--FICS/playerdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index b3f0dfe..2c3002a 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -1274,7 +1274,10 @@ WritePlayerFile(FILE *fp, int p)
int ret;
player *pp = &parray[p];
- if (fprintf(fp, "v %d\n", PLAYER_VERSION) < 0) {
+ if (fp == NULL) {
+ warnx("%s: invalid argument: null pointer detected", __func__);
+ return;
+ } else if (fprintf(fp, "v %d\n", PLAYER_VERSION) < 0) {
warnx("%s: error writing to file! returning...", __func__);
return;
}