blockchain_blackball: error out on fgets error

This commit is contained in:
moneromooo-monero 2018-09-14 16:31:24 +00:00
parent d743994086
commit b1f05f589e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -898,7 +898,11 @@ static std::vector<std::pair<uint64_t, uint64_t>> load_outputs(const std::string
while (1) while (1)
{ {
char s[256]; char s[256];
fgets(s, sizeof(s), f); if (!fgets(s, sizeof(s), f))
{
MERROR("Error reading from " << filename << ": " << strerror(errno));
break;
}
if (feof(f)) if (feof(f))
break; break;
const size_t len = strlen(s); const size_t len = strlen(s);