simplify by using utils::strdup()

This commit is contained in:
Axel Kohlmeyer
2021-03-16 08:35:06 -04:00
parent 2f8770971c
commit 5d5fc4a04d
6 changed files with 19 additions and 57 deletions

View File

@ -96,10 +96,7 @@ char *TextFileReader::next_line(int nparams) {
if (ignore_comments && (ptr = strchr(line, '#'))) *ptr = '\0';
nwords = utils::count_words(line);
if (nwords > 0) {
n = strlen(line);
}
if (nwords > 0) n = strlen(line);
while (nwords == 0 || nwords < nparams) {
char *ptr = fgets(&line[n], MAXLINE - n, fp);