]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/fileio.c
fileio: add new helper call read_line() as bounded getline() replacement
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 15:55:53 +0000 (17:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 18:34:15 +0000 (20:34 +0200)
commit4f9a66a32dda1d9a28f9bb3fa31c2148524bc46a
treefecda10ed2445bbffadf4d02dd14a53cdebd2b57
parenta195dd8e5a0db455b4ab671dbb55ebae66fe8610
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.
src/basic/fileio.c
src/basic/fileio.h
src/test/test-fileio.c