summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/rpc/getrpcent.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index f0b0b91ae63..ab555062553 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -29,7 +29,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getrpcent.c,v 1.3 1996/08/19 08:31:34 tholo Exp $";
+static char *rcsid = "$OpenBSD: getrpcent.c,v 1.4 1996/08/27 03:33:57 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -165,7 +165,8 @@ interpret(val, len)
if (d == 0)
return (0);
- (void) strncpy(d->line, val, len);
+ (void) strncpy(d->line, val, len-1);
+ d->line[len-1] = '\0';
p = d->line;
d->line[len] = '\n';
if (*p == '#')