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

@@ -24,7 +24,7 @@ ctl_rundir(char *dst, size_t size)
"/tmp/" PACKAGE_NAME ".%u", "/tmp/" PACKAGE_NAME ".%u",
}; };
for (int i = 0; i < COUNT(fmt); i++) { for (unsigned i = 0; i < COUNT(fmt); i++) {
char path[128]; char path[128];
int ret = snprintf(dst, size, fmt[i], geteuid()); int ret = snprintf(dst, size, fmt[i], geteuid());
@@ -33,7 +33,7 @@ ctl_rundir(char *dst, size_t size)
((size_t)ret >= sizeof(path))) ((size_t)ret >= sizeof(path)))
continue; continue;
memcpy(path, dst, ret + 1); memcpy(path, dst, (size_t)ret + 1);
char *p = dirname(path); char *p = dirname(path);
if (p && !access(p, W_OK)) 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 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 = { struct ctl_msg req = {
.type = CTL_PATH_STATUS, .type = CTL_PATH_STATUS,