From cc272b06eefb87030bb85b686abdbc22b5ed1c34 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 28 Aug 2011 13:00:29 +0200 Subject: Apply post-1.19.0 patches, bump version to 1.19.1 Signed-off-by: Denys Vlasenko --- shell/cttyhack.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'shell/cttyhack.c') diff --git a/shell/cttyhack.c b/shell/cttyhack.c index 4261289..37ea137 100644 --- a/shell/cttyhack.c +++ b/shell/cttyhack.c @@ -122,10 +122,12 @@ int cttyhack_main(int argc UNUSED_PARAM, char **argv) do { #ifdef __linux__ int s = open_read_close("/sys/class/tty/console/active", - console + 5, sizeof(console) - 5 - 1); + console + 5, sizeof(console) - 5); if (s > 0) { - /* found active console via sysfs (Linux 2.6.38+) */ - console[5 + s] = '\0'; + /* found active console via sysfs (Linux 2.6.38+) + * sysfs string looks like "ttyS0\n" so zap the newline: + */ + console[4 + s] = '\0'; break; } -- cgit v1.1