X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_subst.c;h=ca1e93349e4171950bec5a9b0d1d2fe63fe77211;hb=f8379dd45f4a43595f4027992696ee8d02908bff;hp=640007c705e125876e520fa87a331ecb389b0c41;hpb=98062438c25226e2e4a28ab629de5dfa27a79913;p=collectd.git diff --git a/src/utils_subst.c b/src/utils_subst.c index 640007c7..ca1e9334 100644 --- a/src/utils_subst.c +++ b/src/utils_subst.c @@ -25,6 +25,7 @@ #include "collectd.h" #include "common.h" +#include "utils_subst.h" char *subst (char *buf, size_t buflen, const char *string, int off1, int off2, const char *replacement) @@ -37,7 +38,8 @@ char *subst (char *buf, size_t buflen, const char *string, int off1, int off2, || (NULL == replacement)) return NULL; - sstrncpy (buf_ptr, string, (off1 + 1 > buflen) ? buflen : off1 + 1); + sstrncpy (buf_ptr, string, + ((size_t)off1 + 1 > buflen) ? buflen : (size_t)off1 + 1); buf_ptr += off1; len -= off1;