projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.4'
[collectd.git]
/
src
/
memcached.c
diff --git
a/src/memcached.c
b/src/memcached.c
index
a182578
..
ca93102
100644
(file)
--- a/
src/memcached.c
+++ b/
src/memcached.c
@@
-200,11
+200,10
@@
static int memcached_config (const char *key, const char *value) /* {{{ */
} else if (strcasecmp (key, "Port") == 0) {
int port = (int) (atof (value));
if ((port > 0) && (port <= 65535)) {
} else if (strcasecmp (key, "Port") == 0) {
int port = (int) (atof (value));
if ((port > 0) && (port <= 65535)) {
- snprintf (memcached_port, sizeof (memcached_port), "%i", port);
+ s
s
nprintf (memcached_port, sizeof (memcached_port), "%i", port);
} else {
} else {
- strncpy (memcached_port, value, sizeof (memcached_port));
+ s
s
trncpy (memcached_port, value, sizeof (memcached_port));
}
}
- memcached_port[sizeof (memcached_port) - 1] = '\0';
} else {
return -1;
}
} else {
return -1;
}
@@
-226,13
+225,11
@@
static void submit_counter (const char *type, const char *type_inst,
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)
if (type_inst != NULL)
- {
- strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
- }
+ sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- plugin_dispatch_values (
type,
&vl);
+ plugin_dispatch_values (&vl);
} /* void memcached_submit_cmd */
/* }}} */
} /* void memcached_submit_cmd */
/* }}} */
@@
-250,13
+247,11
@@
static void submit_counter2 (const char *type, const char *type_inst,
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)
if (type_inst != NULL)
- {
- strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
- }
+ sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- plugin_dispatch_values (
type,
&vl);
+ plugin_dispatch_values (&vl);
} /* void memcached_submit_cmd */
/* }}} */
} /* void memcached_submit_cmd */
/* }}} */
@@
-273,13
+268,11
@@
static void submit_gauge (const char *type, const char *type_inst,
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)
if (type_inst != NULL)
- {
- strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
- }
+ sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- plugin_dispatch_values (
type,
&vl);
+ plugin_dispatch_values (&vl);
}
/* }}} */
}
/* }}} */
@@
-297,13
+290,11
@@
static void submit_gauge2 (const char *type, const char *type_inst,
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)
if (type_inst != NULL)
- {
- strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
- }
+ sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
- plugin_dispatch_values (
type,
&vl);
+ plugin_dispatch_values (&vl);
}
/* }}} */
}
/* }}} */