diff options
-rw-r--r-- | sbin/devfs/devfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/devfs/devfs.c b/sbin/devfs/devfs.c index f531f75..b232f2a 100644 --- a/sbin/devfs/devfs.c +++ b/sbin/devfs/devfs.c @@ -162,8 +162,7 @@ efgetln(FILE *fp, char **line) *line = malloc(rv + 1); if (*line == NULL) errx(1, "cannot allocate memory"); - memcpy(*line, cp, rv); - *line[rv] = '\0'; + rv = strlcpy(*line, cp, rv + 1); } assert(rv == strlen(*line)); return (rv); |