fileio: add new helper call read_line() as bounded getline() replacement

read_line() is much like getline(), and returns a line read from a
FILE*, of arbitrary sizes. In contrast to gets() it will grow the buffer
dynamically, and in contrast to getline() it will place a user-specified
boundary on the line.
This commit is contained in:
Lennart Poettering
2017-09-22 20:34:15 +02:00
parent a195dd8e5a
commit 4f9a66a32d
3 changed files with 123 additions and 0 deletions
+2
View File
@@ -101,3 +101,5 @@ int link_tmpfile(int fd, const char *path, const char *target);
int read_nul_string(FILE *f, char **ret);
int mkdtemp_malloc(const char *template, char **ret);
int read_line(FILE *f, size_t limit, char **ret);