From aa723e7102b7ba057ccc3d516865e7a0c984a790 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 13 Jul 2012 10:54:06 +1000 Subject: [PATCH] Check return value of read in BFgets --- driver-bitforce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-bitforce.c b/driver-bitforce.c index c45b2504..ae5b4ce7 100644 --- a/driver-bitforce.c +++ b/driver-bitforce.c @@ -39,7 +39,7 @@ static void BFgets(char *buf, size_t bufLen, int fd) { do --bufLen; - while (likely(bufLen && read(fd, buf, 1) && (buf++)[0] != '\n')); + while (likely(bufLen && read(fd, buf, 1) == 1 && (buf++)[0] != '\n')); buf[0] = '\0'; }