Browse Source

Check return value of read in BFgets

nfactor-troky
Con Kolivas 13 years ago
parent
commit
aa723e7102
  1. 2
      driver-bitforce.c

2
driver-bitforce.c

@ -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…
Cancel
Save