fix multiple coverity defects in parsers.

This commit is contained in:
Enno Rehling 2018-09-03 20:43:17 +02:00
parent af445e5ca1
commit 876113d991
2 changed files with 238 additions and 213 deletions

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,7 @@ int pofile_read(const char *filename, int (*callback)(const char *msgid, const c
if (!F) {
log_error("could not open %s", filename);
return -1;
}
msgctxt[0] = 0;
@ -106,10 +107,10 @@ int pofile_read(const char *filename, int (*callback)(const char *msgid, const c
line = read_line(F);
}
}
if (ferror(F)) {
log_error("read error in %s:%d.", filename, po_lineno);
return -1;
}
err = ferror(F);
fclose(F);
if (err) {
log_error("read error %d in %s:%d.", err, filename, po_lineno);
}
return err;
}