projects
/
util-linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a18d6cf
)
Fix ul_path_read_buffer()
author
Daan De Meyer
<daan.j.demeyer@gmail.com>
Thu, 9 May 2024 10:32:31 +0000
(12:32 +0200)
committer
Chris Hofstaedtler
<zeha@debian.org>
Sun, 26 May 2024 13:52:22 +0000
(15:52 +0200)
The current implementation cuts off the last character of the buffer
if there is no trailing newline.
(cherry picked from commit
6273c12257973cbd3c59a710049ee8a8027bbbb1
)
Gbp-Pq: Topic upstream
Gbp-Pq: Name Fix-ul_path_read_buffer.patch
lib/path.c
patch
|
blob
|
history
diff --git
a/lib/path.c
b/lib/path.c
index 202f19ac4fc0d5a4e3d986100ec08db510eeba62..f897599fd06bba3cdeb03cfe78f44ab8b345e1bb 100644
(file)
--- a/
lib/path.c
+++ b/
lib/path.c
@@
-682,7
+682,7
@@
int ul_path_read_buffer(struct path_cxt *pc, char *buf, size_t bufsz, const char
if (*(buf + rc - 1) == '\n')
buf[--rc] = '\0';
else
- buf[rc
- 1
] = '\0';
+ buf[rc] = '\0';
}
return rc;