diff --git a/ChangeLog b/ChangeLog index 1bf4eb44..3a00578c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,6 +131,7 @@ CVS code - - files.c: read_line() - Rename variable prev to prevnode to avoid confusion. (DLR) + - Rename variable len to buf_len, for consistency. (DLR) load_open_file() - Remove an unneeded clearok(FALSE). (DLR) get_next_filename() diff --git a/src/files.c b/src/files.c index af0205f0..d164db18 100644 --- a/src/files.c +++ b/src/files.c @@ -59,28 +59,28 @@ void new_file(void) #endif } -/* We make a new line of text from buf. buf is length len. If +/* We make a new line of text from buf. buf is length buf_len. If * first_line_ins is TRUE, then we put the new line at the top of the * file. Otherwise, we assume prevnode is the last line of the file, * and put our line after prevnode. */ filestruct *read_line(char *buf, filestruct *prevnode, bool - *first_line_ins, size_t len) + *first_line_ins, size_t buf_len) { filestruct *fileptr = (filestruct *)nmalloc(sizeof(filestruct)); /* Convert nulls to newlines. len is the string's real length * here. */ - unsunder(buf, len); + unsunder(buf, buf_len); - assert(strlen(buf) == len); + assert(strlen(buf) == buf_len); fileptr->data = mallocstrcpy(NULL, buf); #ifndef NANO_SMALL /* If it's a DOS file ("\r\n"), and file conversion isn't disabled, * strip the '\r' part from fileptr->data. */ - if (!ISSET(NO_CONVERT) && len > 0 && buf[len - 1] == '\r') - fileptr->data[len - 1] = '\0'; + if (!ISSET(NO_CONVERT) && buf_len > 0 && buf[buf_len - 1] == '\r') + fileptr->data[buf_len - 1] = '\0'; #endif if (*first_line_ins == TRUE || fileage == NULL) { diff --git a/src/proto.h b/src/proto.h index 5382ff24..6465bf59 100644 --- a/src/proto.h +++ b/src/proto.h @@ -251,7 +251,7 @@ void do_uncut_text(void); /* Public functions in files.c. */ void new_file(void); filestruct *read_line(char *buf, filestruct *prevnode, bool - *first_line_ins, size_t len); + *first_line_ins, size_t buf_len); void load_file(void); void read_file(FILE *f, const char *filename); int open_file(const char *filename, bool newfie, FILE **f);