X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=8f22011ed57c46c94244f8273461fce3fa7af155;hb=155102256542b6dab3261cd2d6dfb000354de425;hp=92950deded7721646414edcbe5cc9c603f5ef836;hpb=e41add16b3f19e89cd746a76c66cd28670037d7d;p=collectd.git diff --git a/src/daemon/common.c b/src/daemon/common.c index 92950ded..8f22011e 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -46,7 +46,6 @@ /* for getaddrinfo */ #include -#include #include #if HAVE_NETINET_IN_H @@ -257,8 +256,8 @@ ssize_t sread (int fd, void *buf, size_t count) assert ((0 > status) || (nleft >= (size_t)status)); - nleft = nleft - status; - ptr = ptr + status; + nleft = nleft - ((size_t) status); + ptr = ptr + ((size_t) status); } return (0); @@ -284,8 +283,8 @@ ssize_t swrite (int fd, const void *buf, size_t count) if (status < 0) return (status); - nleft = nleft - status; - ptr = ptr + status; + nleft = nleft - ((size_t) status); + ptr = ptr + ((size_t) status); } return (0); @@ -356,7 +355,7 @@ int strjoin (char *buffer, size_t buffer_size, } assert (buffer[buffer_size - 1] == 0); - return (strlen (buffer)); + return ((int) strlen (buffer)); } int strsubstitute (char *str, char c_from, char c_to) @@ -665,8 +664,8 @@ int check_create_dir (const char *file_orig) * Join the components together again */ dir[0] = '/'; - if (strjoin (dir + path_is_absolute, dir_len - path_is_absolute, - fields, i + 1, "/") < 0) + if (strjoin (dir + path_is_absolute, (size_t) (dir_len - path_is_absolute), + fields, (size_t) (i + 1), "/") < 0) { ERROR ("strjoin failed: `%s', component #%i", file_orig, i); return (-1);