eta: fix run_str_condensed overflow with maximum jobs
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 23 Dec 2017 08:01:01 +0000 (08:01 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 24 Dec 2017 23:34:39 +0000 (23:34 +0000)
When the maximum number of jobs all have a different state to their
previous job, run_str didn't have space for the terminating null. Fix
this by making run_str one character larger.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
eta.c

diff --git a/eta.c b/eta.c
index a156559..c9b2e91 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -9,7 +9,7 @@
 #include "lib/pow2.h"
 
 static char __run_str[REAL_MAX_JOBS + 1];
-static char run_str[__THREAD_RUNSTR_SZ(REAL_MAX_JOBS)];
+static char run_str[__THREAD_RUNSTR_SZ(REAL_MAX_JOBS) + 1];
 
 static void update_condensed_str(char *rstr, char *run_str_condensed)
 {