Commit 820a0bdbe6a9719042a48290367c260f789771c0

ckolivas 2014-06-28T10:16:24

Copy back the buffer after we've stripped the inprocess field on bflsc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/driver-bflsc.c b/driver-bflsc.c
index 70827e3..bc1ecad 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -1417,7 +1417,10 @@ static int process_results(struct cgpu_info *bflsc, int dev, char *pbuf, int *no
 	buf = strdupa(pbuf);
 	if (!strncasecmp(buf, "INPROCESS", 9)) {
 		tmp = strsep(&buf, "\n");
-		sscanf(tmp, "INPROCESS:%d", in_process);
+		if (likely(buf)) {
+			sscanf(tmp, "INPROCESS:%d", in_process);
+			strcpy(pbuf, buf);
+		}
 	}
 	res = tolines(bflsc, dev, buf, &lines, &items, C_GETRESULTS);
 	if (!res || lines < 1) {