diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 09:20:09 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 09:20:09 +0100 |
| commit | df5844ffeae9f3f6958c720f5088f4fabb7954cc (patch) | |
| tree | 62db490a0c351703bf01250e374d1b794eff3e72 /FICS | |
| parent | 1e3336d38a54128d44e2b9f5b5ff62088f6ed5cc (diff) | |
Added null check
Diffstat (limited to 'FICS')
| -rw-r--r-- | FICS/playerdb.c | 5 |
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; } |
