Commit 6ff7893fddaa6cd7dcbcb32df37d8cde3852f88f

Con Kolivas 2013-08-30T16:14:25

Check the return value of tolines in bflsc driver.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/driver-bflsc.c b/driver-bflsc.c
index b5b68fd..abbe809 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -1305,13 +1305,14 @@ static int process_results(struct cgpu_info *bflsc, int dev, char *buf, int *non
 	int que, i, lines, count;
 	char xlink[17];
 	char *tmp, *tmp2;
+	bool res;
 
 	*nonces = 0;
 
 	xlinkstr(xlink, sizeof(xlink), dev, sc_info);
 
-	tolines(bflsc, dev, buf, &lines, &items, C_GETRESULTS);
-	if (lines < 1) {
+	res = tolines(bflsc, dev, buf, &lines, &items, C_GETRESULTS);
+	if (!res || lines < 1) {
 		tmp = str_text(buf);
 		applog(LOG_ERR, "%s%i:%s empty result (%s) ignored",
 					bflsc->drv->name, bflsc->device_id, xlink, tmp);