From: Thomas Guthmann Date: Wed, 8 Jun 2016 03:03:47 +0000 (+1000) Subject: Bug#1059 : Remove any white spaces in ethstats stat names (affects VMXNet3 interface) X-Git-Tag: collectd-5.5.2~5^2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=21602dea4a6ac2a9003c2f2b0aa4c87ce5e475bf;p=collectd.git Bug#1059 : Remove any white spaces in ethstats stat names (affects VMXNet3 interface) --- diff --git a/src/ethstat.c b/src/ethstat.c index dec14f3d..a30a5d15 100644 --- a/src/ethstat.c +++ b/src/ethstat.c @@ -312,9 +312,13 @@ static int ethstat_read_interface (char *device) for (i = 0; i < n_stats; i++) { - const char *stat_name; + char *stat_name; stat_name = (void *) &strings->data[i * ETH_GSTRING_LEN]; + /* Remove leading spaces in key name */ + while (isspace ((int) *stat_name)) + stat_name++; + DEBUG("ethstat plugin: device = \"%s\": %s = %"PRIu64, device, stat_name, (uint64_t) stats->data[i]); ethstat_submit_value (device,