From: Benjamin Gilbert Date: Wed, 11 Mar 2015 04:28:36 +0000 (-0400) Subject: hddtemp: Improve robustness of test X-Git-Tag: collectd-5.7.0~72^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=442696dca3162676b63735afaf94c2b35d5ad840;p=collectd.git hddtemp: Improve robustness of test Don't rely on signedness of buffer_size. --- diff --git a/src/hddtemp.c b/src/hddtemp.c index 4e275dc8..11785376 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -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;