diff options
author | maxim <maxim@FreeBSD.org> | 2006-06-14 11:45:01 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-06-14 11:45:01 +0000 |
commit | dd28c26ad5dacbf923394872ab6b28b291c20b93 (patch) | |
tree | e04ff2b635f72f6e81d59f09f2ab44c05d6f7e1b /sbin | |
parent | 1092903e053d6bca1cb8448e6f1e34839c574128 (diff) | |
download | FreeBSD-src-dd28c26ad5dacbf923394872ab6b28b291c20b93.zip FreeBSD-src-dd28c26ad5dacbf923394872ab6b28b291c20b93.tar.gz |
o Replace (an incorrect) string copy gymnastics with strlcpy(3).
PR: bin/98905
Submitted by: Fabian Keil
MFC after: 1 week
Diffstat (limited to 'sbin')
-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); |