wayclip

Wayland clipboard utility
git clone git://git.nihaljere.xyz/wayclip
Log | Files | Refs | README | LICENSE

commit bba0eb3949da2dc612dfaafa68a7d575fc4a0cec
parent 7f5c6936f3f46b7914a6e1c2c15066037efcb58b
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Wed, 23 Feb 2022 12:42:14 -0600

util: copyfd: make variables more local, fix type

Diffstat:
Mutil.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/util.c b/util.c @@ -23,17 +23,17 @@ warn(const char *const error) void copyfd(int out, int in) { - char buf[BUFSIZ], *ptr; + char buf[BUFSIZ]; - size_t rcount, wcount; do { - rcount = read(in, buf, BUFSIZ); + ssize_t rcount = read(in, buf, BUFSIZ); if (rcount == -1) { warn("read failed"); + return; } - wcount = 0; - ptr = buf; + size_t wcount = 0; + char *ptr = buf; while (wcount < rcount) { ssize_t len = write(out, ptr, rcount); if (len == -1) {