]> git.proxmox.com Git - mirror_lxcfs.git/commit
cgfs: improve read_file and append_line
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 7 Jan 2016 11:59:55 +0000 (12:59 +0100)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 7 Jan 2016 19:13:27 +0000 (11:13 -0800)
commit336e326af86ce6a67774a8d5e6e72df53f040a4a
tree499e3272c44d840649bb12799268d1e574e1b1cc
parente658c6027bb50d3b1cd43ce1e208c18ddcf8af5d
cgfs: improve read_file and append_line

getline() returns the length which can be passed to
append_line to avoid a strlen() call.

Additionally with the length already known memcpy() can be
used instead of strcpy(). A +1 to the length will include
the terminating null byte as it is included in getline(3)'s
output.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgfs.c