From de06600394876233ace50f8dbd77e75990a9e434 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 15 Feb 2019 10:07:55 +0100 Subject: [PATCH] fix coverity errors --- src/kernel/save.c | 3 +++ src/report.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kernel/save.c b/src/kernel/save.c index a914b1c32..45da22a7c 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1186,6 +1186,9 @@ int readgame(const char *filename) binstore_done(&store); fstream_done(&strm); } + else { + fclose(F); + } return n; } diff --git a/src/report.c b/src/report.c index 51ece5d93..7ea25c8d6 100644 --- a/src/report.c +++ b/src/report.c @@ -1443,7 +1443,7 @@ void pump_paragraph(sbstring *sbp, stream *out, size_t maxlen, bool isfinal) ++begin; } pos = begin; - while (pos) { + do { char *next = strchr(pos+1, ' '); if (next == NULL) { if (isfinal) { @@ -1474,7 +1474,7 @@ void pump_paragraph(sbstring *sbp, stream *out, size_t maxlen, bool isfinal) break; } pos = next; - } + } while (pos); } if (isfinal) { char *pos = sbp->begin;