rename utils::fgets_trunc_nl() to utils::fgets_trunc()

This commit is contained in:
Axel Kohlmeyer
2021-04-27 18:32:51 -04:00
parent f29744b5bc
commit 7b1b57aa9b
4 changed files with 14 additions and 14 deletions

View File

@ -168,7 +168,7 @@ const char *utils::guesspath(char *buf, int len, FILE *fp)
// read line into buffer. if line is too long keep reading until EOL or EOF
// but return only the first part with a newline at the end.
char *utils::fgets_trunc_nl(char *buf, int size, FILE *fp)
char *utils::fgets_trunc(char *buf, int size, FILE *fp)
{
constexpr int MAXDUMMY = 256;
char dummy[MAXDUMMY];
@ -271,7 +271,7 @@ int utils::read_lines_from_file(FILE *fp, int nlines, int nmax,
if (me == 0) {
if (fp) {
for (int i = 0; i < nlines; i++) {
ptr = fgets_trunc_nl(ptr,nmax,fp);
ptr = fgets_trunc(ptr,nmax,fp);
if (!ptr) break; // EOF?
// advance ptr to end of string
ptr += strlen(ptr);