mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 10:23:17 +00:00
Freshclam, Sigtool, Clamconf: fix database line count if has empty lines
Fixes: https://github.com/Cisco-Talos/clamav/issues/1390
This commit is contained in:
parent
52b201762f
commit
2e544984f0
1 changed files with 8 additions and 0 deletions
|
@ -479,7 +479,15 @@ unsigned int countlines(const char *filename)
|
|||
return 0;
|
||||
|
||||
while (fgets(buff, sizeof(buff), fh)) {
|
||||
// ignore comments
|
||||
if (buff[0] == '#') continue;
|
||||
|
||||
// ignore empty lines in CR/LF format
|
||||
if (buff[0] == '\r' && buff[1] == '\n') continue;
|
||||
|
||||
// ignore empty lines in LF format
|
||||
if (buff[0] == '\n') continue;
|
||||
|
||||
lines++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue