mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +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
|
do
|
||||||
--bufLen;
|
--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';
|
buf[0] = '\0';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user