mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Check return value of read in BFgets
This commit is contained in:
parent
cdf325d751
commit
aa723e7102
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user