Skip to content
Snippets Groups Projects
Commit dd9c9ffc authored by Daniel Salzman's avatar Daniel Salzman
Browse files

internal/getline: set correct output buffer length if reallocated

parent f7217860
No related branches found
No related tags found
1 merge request!393Knsupdate cleanup
......@@ -49,11 +49,11 @@ ssize_t knot_getline(char **lineptr, size_t *n, FILE *stream)
return -1;
}
*lineptr = tmp;
*n = length + 1;
}
memcpy(*lineptr, buffer, length);
(*lineptr)[length] = '\0';
*n = length;
return length;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment