Commit c08368bd authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

fix the last ngetdelim() tweak

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1903 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -284,12 +284,12 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
/* Make room for the null character. */
if (indx >= *n) {
*lineptr = charealloc(*lineptr, indx + 1);
*n = indx + 1;
*lineptr = charealloc(*lineptr, *n + 128);
*n += 128;
}
/* Null terminate the buffer. */
(*lineptr)[indx++] = '\0';
null_at(lineptr, indx++);
/* The last line may not have the delimiter, we have to return what
* we got and the error will be seen on the next iteration. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment