Fix buffer size in pickersCLI.cpp (#8282)

Was a bit too diabolical.

`fgets` reads size-1 bytes and writes `\0` after it, so we should be fine with `sizeof(buffer)` here, which also more resilient to future errors than any duplicated value.
This commit is contained in:
Andrey Alekseenko
2025-02-21 06:04:15 +01:00
committed by greg landrum
parent 5bbb874eb2
commit 70b7e13bed

View File

@@ -34,7 +34,7 @@ static unsigned int LoadDatabase(FILE *fp) {
char buffer[32768];
unsigned int result = 0;
while (fgets(buffer, 327666, fp)) {
while (fgets(buffer, sizeof(buffer), fp)) {
if (buffer[0] == '#' || buffer[0] == ' ' || buffer[0] == '\t') continue;
char *ptr = buffer;
while (*ptr && *ptr != ' ' && *ptr != '\t') ptr++;