From e6f48eb604783ff91911a93926fb142b23dcbb95 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 7 Jun 1996 22:37:37 +0000 Subject: [PATCH] Remove tty-prefix from ut_id; this field is usually very short. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@565 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/login/utmp_login.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appl/login/utmp_login.c b/appl/login/utmp_login.c index f49c8ee43..ab5ff3c2b 100644 --- a/appl/login/utmp_login.c +++ b/appl/login/utmp_login.c @@ -12,6 +12,7 @@ void utmp_login(char *tty, char *username, char *hostname) int fd; char *ttyx; /* tty w/o /dev/* */ + char *id; ttyx = tty; @@ -49,7 +50,10 @@ void utmp_login(char *tty, char *username, char *hostname) # ifdef HAVE_UT_ID /* any particular reason to not include "tty" ? */ - strncpy(utmp.ut_id, ttyx, sizeof(utmp.ut_id)); + id = ttyx; + if(strncmp(ttyx, "tty", 3) == 0) + id += 3; + strncpy(utmp.ut_id, id, sizeof(utmp.ut_id)); # endif