continue;
}
- if ('e' == line[0]) { /* e:<type>:<bytes> */
+ if (line[0] == 'e') { /* e:<type>:<bytes> */
- 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;
}
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);