merge strcpy_truncate branch

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5027 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-06-09 19:25:40 +00:00
parent e255dfc950
commit a5f54865d4
87 changed files with 689 additions and 499 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -55,7 +55,8 @@ loop(int s)
err(1, "select");
if(FD_ISSET(0, &fds)){
fgets(cmd, sizeof(cmd), stdin);
strcpy(cmd + strlen(cmd) - 1, "\r\n");
cmd[strlen(cmd) - 1] = '\0';
strcat_truncate (cmd, "\r\n", sizeof(cmd));
write(s, cmd, strlen(cmd));
}
if(FD_ISSET(s, &fds)){