summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1e34eee)
raw | patch | inline | side by side (parent: 1e34eee)
author | Florian Forster <octo@collectd.org> | |
Fri, 3 Jul 2015 09:52:50 +0000 (11:52 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 3 Jul 2015 09:52:50 +0000 (11:52 +0200) |
Also fixes a shadowed local variable warning.
src/collectdctl.c | patch | blob | history |
diff --git a/src/collectdctl.c b/src/collectdctl.c
index 8357ce841838cad2f85238b5bbe3ba1758e1db43..febc99833aaa917f084e4d606e34a84c70b90fb4 100644 (file)
--- a/src/collectdctl.c
+++ b/src/collectdctl.c
return count;
} /* count_chars */
-static int array_grow (void **array, int *array_len, size_t elem_size)
+static int array_grow (void **array, size_t *array_len, size_t elem_size)
{
void *tmp;
int timeout = -1;
lcc_identifier_t *identifiers = NULL;
- int identifiers_num = 0;
+ size_t identifiers_num = 0;
char **plugins = NULL;
- int plugins_num = 0;
+ size_t plugins_num = 0;
int status;
int i;
values_types[values_len] = LCC_TYPE_GAUGE;
}
else { /* integer */
- values[values_len].counter = strtol (value, &endptr, 0);
+ values[values_len].counter = (counter_t) strtoull (value, &endptr, 0);
values_types[values_len] = LCC_TYPE_COUNTER;
}
++values_len;
int status;
while (42) {
- int c;
+ int opt;
- c = getopt (argc, argv, "s:h");
+ opt = getopt (argc, argv, "s:h");
- if (c == -1)
+ if (opt == -1)
break;
- switch (c) {
+ switch (opt) {
case 's':
snprintf (address, sizeof (address), "unix:%s", optarg);
address[sizeof (address) - 1] = '\0';