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;