Commit 4ba96a7b5543b572f1110fd203e1384f3157761b

Angus Gratton 2013-12-14T14:06:27

Align device status lines same regardless of number of temp status or >10 ASICs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/driver-drillbit.c b/driver-drillbit.c
index 39625c2..0512ea0 100644
--- a/driver-drillbit.c
+++ b/driver-drillbit.c
@@ -428,11 +428,14 @@ static void drillbit_get_statline_before(char *buf, size_t bufsiz, struct cgpu_i
 {
 	struct drillbit_info *info = drillbit->device_data;
 
-        tailsprintf(buf, bufsiz, "%c%d", info->product[0], info->num_chips);
+        tailsprintf(buf, bufsiz, "%c%-2d", info->product[0], info->num_chips);
 
         if((info->capabilities & CAP_TEMP) && info->temp != 0) {
           tailsprintf(buf, bufsiz, " %d.%dC (%d.%dC)", info->temp/10, info->temp%10,
                       info->max_temp/10, info->max_temp%10);
+        } else {
+          // Space out to the same width as if there was a temp field in place
+          tailsprintf(buf, bufsiz, "              ");
         }
 
         tailsprintf(buf, bufsiz, " | ");