Code

virt plugin: Fix indentation and some whitespace.
[collectd.git] / src / hddtemp.c
index 4e275dc87c8193ac4ab121dbe4fdb49594eb6c9a..cb6f6d25b9a486d39a3b18c5c1f9e559e7401e53 100644 (file)
@@ -23,7 +23,7 @@
  *   Vincent StehlĂ© <vincent.stehle at free.fr>
  *   Florian octo Forster <octo at collectd.org>
  *   Sebastian Harl <sh at tokkee.org>
- *   Benjamin Gilbert <bgilbert at cs.cmu.edu>
+ *   Benjamin Gilbert <bgilbert at backtick.net>
  *
  * TODO:
  *   Do a pass, some day, and spare some memory. We consume too much for now
@@ -171,7 +171,7 @@ static char *hddtemp_query_daemon (void)
        buffer_fill = 0;
        while (1)
        {
-               if (buffer_fill >= buffer_size - 1)
+               if ((buffer_size == 0) || (buffer_fill >= buffer_size - 1))
                {
                        if (buffer_size == 0)
                                buffer_size = 1024;
@@ -258,7 +258,6 @@ static void hddtemp_submit (char *type_instance, double value)
 
        vl.values = &(value_t) { .gauge = value };
        vl.values_len = 1;
-       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
        sstrncpy (vl.type, "temperature", sizeof (vl.type));
        sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));