logging: handle too many file logs

Don't rely on an assert to catch insufficient maximum number of file
logs (e.g. after introducing a new file log).
This commit is contained in:
Miroslav Lichvar 2020-06-24 11:27:41 +02:00
parent b0fe443632
commit c9f03fb222

View file

@ -243,7 +243,10 @@ LOG_CloseParentFd()
LOG_FileID
LOG_FileOpen(const char *name, const char *banner)
{
assert(n_filelogs < MAX_FILELOGS);
if (n_filelogs >= MAX_FILELOGS) {
assert(0);
return -1;
}
logfiles[n_filelogs].name = name;
logfiles[n_filelogs].banner = banner;