Code

ethstat plugin: Fix off-by-one error.
authorFlorian Forster <octo@collectd.org>
Sun, 23 Sep 2012 09:56:58 +0000 (11:56 +0200)
committerFlorian Forster <octo@collectd.org>
Sun, 23 Sep 2012 09:56:58 +0000 (11:56 +0200)
This hopefully fixes Github issue #135.

src/ethstat.c

index ae1b68931d898830cca2a67e9aa2cc8034371803..746fc613d0d332a883d947c0029c5640d6e006b4 100644 (file)
@@ -104,7 +104,7 @@ static int ethstat_add_map (const oconfig_item_t *ci) /* {{{ */
   memset (map, 0, sizeof (*map));
 
   sstrncpy (map->type, ci->values[1].value.string, sizeof (map->type));
-  if (ci->values_num == 2)
+  if (ci->values_num == 3)
     sstrncpy (map->type_instance, ci->values[2].value.string,
         sizeof (map->type_instance));