summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bd86ee)
raw | patch | inline | side by side (parent: 6bd86ee)
author | Benjamin Gilbert <bgilbert@cs.cmu.edu> | |
Wed, 11 Mar 2015 04:28:36 +0000 (00:28 -0400) | ||
committer | Benjamin Gilbert <bgilbert@backtick.net> | |
Mon, 19 Sep 2016 06:35:12 +0000 (01:35 -0500) |
Don't rely on signedness of buffer_size.
src/hddtemp.c | patch | blob | history |
diff --git a/src/hddtemp.c b/src/hddtemp.c
index 4e275dc87c8193ac4ab121dbe4fdb49594eb6c9a..11785376ea7a261904e3f41d3c8e4015a3c3e41b 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
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;