From 13d11705bf0117365afc3f9210f4d568a2baa69c Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 8 Aug 2005 02:21:55 +0200 Subject: switch some strlcpy's to memcpy strlcpy counts the sourec string lengt and is therefore not suitable to copy a defined length of characters from one string to another. Signed-off-by: Kay Sievers --- udev_rules.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'udev_rules.c') diff --git a/udev_rules.c b/udev_rules.c index d86b8e8599..d42b219d7d 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -187,7 +187,8 @@ static int import_keys_into_env(struct udevice *udev, const char *buf, size_t bu if (bufline[0] == COMMENT_CHARACTER) continue; - strlcpy(line, bufline, count+1); + memcpy(line, bufline, count); + line[count] = '\0'; linepos = line; if (get_key(&linepos, &variable, &value) == 0) { -- cgit v1.2.3-54-g00ecf