From: Florian Forster Date: Thu, 7 Dec 2017 16:10:05 +0000 (+0100) Subject: Merge branch 'collectd-5.7' into collectd-5.8 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=85d892df2794d992c8e3554d8990d1306f114c11;p=collectd.git Merge branch 'collectd-5.7' into collectd-5.8 --- 85d892df2794d992c8e3554d8990d1306f114c11 diff --cc src/email.c index 00e7413d,611da560..e1ce2185 --- a/src/email.c +++ b/src/email.c @@@ -298,13 -298,10 +298,10 @@@ static void *collect(void *arg) continue; } - if ('e' == line[0]) { /* e:: */ + if (line[0] == 'e') { /* e:: */ - char *ptr = NULL; - char *type = strtok_r(line + 2, ":", &ptr); - char *tmp = strtok_r(NULL, ":", &ptr); - int bytes = 0; - - if (tmp == NULL) { + char *type = line + 2; + char *bytes_str = strchr(type, ':'); + if (bytes_str == NULL) { log_err("collect: syntax error in line '%s'", line); continue; } @@@ -379,8 -378,9 +378,9 @@@ static void *open_connection(void __att sstrncpy(addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1)); errno = 0; - if (-1 == - bind(connector_socket, (struct sockaddr *)&addr, - offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path))) { + if (bind(connector_socket, (struct sockaddr *)&addr, - offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path)) == -1) { ++ offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path)) == ++ -1) { char errbuf[1024]; disabled = 1; close(connector_socket);