diff options
author | Bruno Rohee <rohee@cvs.openbsd.org> | 2003-03-30 22:28:06 +0000 |
---|---|---|
committer | Bruno Rohee <rohee@cvs.openbsd.org> | 2003-03-30 22:28:06 +0000 |
commit | 332d4f286d988251510c460e02f95231d49468ed (patch) | |
tree | d14827b96e427ad43a3911015d329398021904cd /sys/miscfs | |
parent | 579faddb60a573ca91a39270749a097bb4ed1d07 (diff) |
Ensure that all files in /kern end with a newline (machine, model,
osrelease and ostype were not).
ok tedu@
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 3db0fadc84e..383bb5df40b 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.29 2003/01/31 17:37:50 art Exp $ */ +/* $OpenBSD: kernfs_vnops.c,v 1.30 2003/03/30 22:28:05 rohee Exp $ */ /* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ /* @@ -342,8 +342,14 @@ kernfs_xread(kt, off, bufp, len) case KTT_STRING: { char *cp = kt->kt_data; + size_t len = strlen(cp); + + if (len && cp[len - 1] != '\n') { + strlcpy(*bufp, cp, KSTRING - 1); + strlcat(*bufp, "\n", KSTRING); + } else + *bufp = cp; - *bufp = cp; break; } |