Merge pull request #1397 from micahsnyder/CLAM-2711-freshclam-sigtool-clamconf-countlines-empty-lines

Freshclam, Sigtool, Clamconf: fix database line count if has empty lines
pull/1366/head
Micah Snyder 4 months ago committed by GitHub
commit 7f60cc7990
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      common/misc.c

@ -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…
Cancel
Save