X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Femail.c;h=deb660061f27f261cd958fb5c79a672933a28c93;hb=c4439c9cb3e2348ad7013644731de27a55eca478;hp=376dd6a53dd6a61ad99e5df488671b0c573f5ccc;hpb=b9b5e5d573d0011c4f3276e9b84b73ba4dd2e870;p=collectd.git diff --git a/src/email.c b/src/email.c index 376dd6a5..deb66006 100644 --- a/src/email.c +++ b/src/email.c @@ -40,8 +40,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include @@ -260,7 +260,6 @@ static void *collect(void *arg) { while (42) { /* 256 bytes ought to be enough for anybody ;-) */ char line[256 + 1]; /* line + '\0' */ - int len = 0; errno = 0; if (fgets(line, sizeof(line), this->socket) == NULL) { @@ -272,7 +271,7 @@ static void *collect(void *arg) { break; } - len = strlen(line); + size_t len = strlen(line); if ((line[len - 1] != '\n') && (line[len - 1] != '\r')) { log_warn("collect: line too long (> %" PRIsz " characters): " "'%s' (truncated)", @@ -287,7 +286,7 @@ static void *collect(void *arg) { continue; } - line[len - 1] = 0; + line[len - 1] = '\0'; log_debug("collect: line = '%s'", line);