1
0
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:
Con Kolivas 2012-07-13 10:54:06 +10:00
parent cdf325d751
commit aa723e7102

View File

@ -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';
}