Code cleanup

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2020-01-07 13:00:51 +00:00
parent 0b26eb108d
commit 1c38034265
3 changed files with 5 additions and 5 deletions

View File

@@ -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:

View File

@@ -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))

View File

@@ -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,