summaryrefslogtreecommitdiff
path: root/libexec/telnetd/telnetd.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2003-05-08 12:17:37 +0000
committerBob Beck <beck@cvs.openbsd.org>2003-05-08 12:17:37 +0000
commit867845811eecb1aac0a307b16be214b0991d0564 (patch)
tree86c8920881addcb8b7ced43bdd40cb7b0f8e3d76 /libexec/telnetd/telnetd.c
parent3adeb8c3924d25d0470010bbd9c39ce91db03bb4 (diff)
squish a strcopy, ok krw@
Diffstat (limited to 'libexec/telnetd/telnetd.c')
-rw-r--r--libexec/telnetd/telnetd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index 361e590777a..2713988ee66 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -783,7 +783,8 @@ show_issue(void)
f = fopen("/etc/issue", "r");
if(f){
while(fgets(buf, sizeof(buf)-2, f)){
- strcpy(buf + strcspn(buf, "\r\n"), "\r\n");
+ size_t off = strcspn(buf, "\r\n");
+ strlcpy(buf + off, "\r\n", sizeof(buf) - off);
writenet((unsigned char*)buf, strlen(buf));
}
fclose(f);