From d54080fbedf049e7ad51154073d29840d36c6c29 Mon Sep 17 00:00:00 2001 From: wdlkmpx Date: Fri, 12 Feb 2021 21:19:34 +0800 Subject: [PATCH] scoreboard.c: fix segfault --- src/scoreboard.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scoreboard.c b/src/scoreboard.c index 688bc26..23d8ea2 100644 --- a/src/scoreboard.c +++ b/src/scoreboard.c @@ -98,6 +98,9 @@ gint read_score(struct score_board *b, struct score_board_full **bf, gint *nbf) memset(b, 0, sizeof(struct score_board) * 10); if (!(fp = fopen(score_file, "r"))) { + if (nbf) { + *nbf = 0; + } g_free (score_file); return TRUE; }