From 3ca63772a3d8f21ee312a987164feec6ddde10cf Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Mon, 16 Sep 2024 17:43:43 +0300 Subject: [PATCH] [cmds] Fix off-by-one bug in getty @T command The `@T` command, when placed in /etc/issue, displays the current system time. The shuffling of the date string in `when()` had an off-by-one error, which meant that instead of showing `17:42:00`, it showed `77:42:00` --- elkscmd/sys_utils/getty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elkscmd/sys_utils/getty.c b/elkscmd/sys_utils/getty.c index e8d942352..6c45525b7 100644 --- a/elkscmd/sys_utils/getty.c +++ b/elkscmd/sys_utils/getty.c @@ -138,7 +138,7 @@ void when(void) { Result[2] = Result[6] = '-'; - for (n=20; n>12; n--) + for (n=20; n>11; n--) Result[n] = Result[n-1]; Result[11] = Result[20] = '\0';