fix coverity errors

This commit is contained in:
Enno Rehling 2019-02-15 10:07:55 +01:00
parent 57c2772baf
commit f744cebe66
2 changed files with 5 additions and 2 deletions

View File

@ -1186,6 +1186,9 @@ int readgame(const char *filename)
binstore_done(&store); binstore_done(&store);
fstream_done(&strm); fstream_done(&strm);
} }
else {
fclose(F);
}
return n; return n;
} }

View File

@ -1443,7 +1443,7 @@ void pump_paragraph(sbstring *sbp, stream *out, size_t maxlen, bool isfinal)
++begin; ++begin;
} }
pos = begin; pos = begin;
while (pos) { do {
char *next = strchr(pos+1, ' '); char *next = strchr(pos+1, ' ');
if (next == NULL) { if (next == NULL) {
if (isfinal) { if (isfinal) {
@ -1474,7 +1474,7 @@ void pump_paragraph(sbstring *sbp, stream *out, size_t maxlen, bool isfinal)
break; break;
} }
pos = next; pos = next;
} } while (pos);
} }
if (isfinal) { if (isfinal) {
char *pos = sbp->begin; char *pos = sbp->begin;