diff options
author | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
---|---|---|
committer | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
commit | 0692b963aa3cb846d8abab5ef5247c4dbb3fec96 (patch) | |
tree | f13776d25da3e1adc1445aef22e7566ac98cbe84 /lib/path.c | |
parent | losetup: added file format option to the man page (diff) | |
parent | partx: document -d vs. --nr and fix test (diff) | |
download | kernel-qcow2-util-linux-kernel-qcow2.tar.gz kernel-qcow2-util-linux-kernel-qcow2.tar.xz kernel-qcow2-util-linux-kernel-qcow2.zip |
lib/losetup: merge remote-tracking branch 'util-linux/master'kernel-qcow2
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
Diffstat (limited to 'lib/path.c')
-rw-r--r-- | lib/path.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/path.c b/lib/path.c index f7fd19592..8dce1da40 100644 --- a/lib/path.c +++ b/lib/path.c @@ -610,9 +610,10 @@ int ul_path_read_buffer(struct path_cxt *pc, char *buf, size_t bufsz, const char /* Remove tailing newline (usual in sysfs) */ if (rc > 0 && *(buf + rc - 1) == '\n') - --rc; + buf[--rc] = '\0'; + else + buf[rc - 1] = '\0'; - buf[rc] = '\0'; return rc; } |