From 442696dca3162676b63735afaf94c2b35d5ad840 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 11 Mar 2015 00:28:36 -0400 Subject: [PATCH] hddtemp: Improve robustness of test Don't rely on signedness of buffer_size. --- src/hddtemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.11.0