extern char *optarg;
extern int optind;
+__attribute__((noreturn))
static void exit_usage (const char *name, int status) {
fprintf ((status == 0) ? stdout : stderr,
"Usage: %s [options] <command> [cmd options]\n\n"
"Hostname defaults to the local hostname if omitted (e.g., uptime/uptime).\n"
"No error is returned if the specified identifier does not exist.\n"
- "\n"PACKAGE" "VERSION", http://collectd.org/\n"
- "by Florian octo Forster <octo@verplant.org>\n"
+ "\n"PACKAGE_NAME" "PACKAGE_VERSION", http://collectd.org/\n"
+ "by Florian octo Forster <octo@collectd.org>\n"
"for contributions see `AUTHORS'\n"
, name);
exit (status);
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_len = 0;
value = tmp;
- while (value != 0) {
+ while (value != NULL) {
char *dot, *endptr;
tmp = strchr (value, (int)':');
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 n;
+ int opt;
- n = getopt (argc, argv, "s:h");
+ opt = getopt (argc, argv, "s:h");
- if (n == -1)
+ if (opt == -1)
break;
- switch (n) {
+ switch (opt) {
case 's':
snprintf (address, sizeof (address), "unix:%s", optarg);
address[sizeof (address) - 1] = '\0';