Length of the ANSI escaped runlevels string is 20 chars, need 21

Problem reported by @wkz

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-10-23 19:20:25 +02:00
parent a6290da210
commit 51c5f3cbfa
+1 -1
View File
@@ -431,7 +431,7 @@ static int show_version(char *arg)
char *runlevel_string(int runlevel, int levels)
{
int i, pos = 1;
static char lvl[20];
static char lvl[21];
memset(lvl, 0, sizeof(lvl));
lvl[0] = '[';