From 1c38034265435adee8c1efc35695bbb0865fb8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Tue, 7 Jan 2020 13:00:51 +0000 Subject: [PATCH] Code cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- src/bind.c | 4 ++-- src/ctl.c | 4 ++-- src/path.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bind.c b/src/bind.c index aeb6d40..9624ffc 100644 --- a/src/bind.c +++ b/src/bind.c @@ -304,8 +304,8 @@ gt_bind(int argc, char **argv) break; case CTL_STATE: if (mud_set_state(mud, (struct sockaddr *)&req.path.addr, - req.path.state, req.path.rate_tx, - req.path.rate_rx, 0, req.path.fixed_rate)) + req.path.state, req.path.rate_tx, + req.path.rate_rx, 0, req.path.fixed_rate)) res.ret = errno; break; case CTL_PATH_STATUS: diff --git a/src/ctl.c b/src/ctl.c index f52a2b2..ee01ccc 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -24,7 +24,7 @@ ctl_rundir(char *dst, size_t size) "/tmp/" PACKAGE_NAME ".%u", }; - for (int i = 0; i < COUNT(fmt); i++) { + for (unsigned i = 0; i < COUNT(fmt); i++) { char path[128]; int ret = snprintf(dst, size, fmt[i], geteuid()); @@ -33,7 +33,7 @@ ctl_rundir(char *dst, size_t size) ((size_t)ret >= sizeof(path))) continue; - memcpy(path, dst, ret + 1); + memcpy(path, dst, (size_t)ret + 1); char *p = dirname(path); if (p && !access(p, W_OK)) diff --git a/src/path.c b/src/path.c index cb32949..850a5d5 100644 --- a/src/path.c +++ b/src/path.c @@ -97,7 +97,7 @@ gt_path_cmp_addr(struct sockaddr_storage *a, struct sockaddr_storage *b) } static int -gt_path_status(int fd, int state, struct sockaddr_storage *addr) +gt_path_status(int fd, enum mud_state state, struct sockaddr_storage *addr) { struct ctl_msg req = { .type = CTL_PATH_STATUS,