From 065db052211d3bf08d9b0f698a79a8798faf11d2 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 20 May 2009 17:57:52 +0200 Subject: use more efficient string copying --- udev/udevadm-trigger.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'udev/udevadm-trigger.c') diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c index 15e7dc17fb..c256a9e5da 100644 --- a/udev/udevadm-trigger.c +++ b/udev/udevadm-trigger.c @@ -49,8 +49,7 @@ static void exec_list(struct udev_enumerate *udev_enumerate, const char *action) printf("%s\n", udev_list_entry_get_name(entry)); if (dry_run) continue; - util_strlcpy(filename, udev_list_entry_get_name(entry), sizeof(filename)); - util_strlcat(filename, "/uevent", sizeof(filename)); + util_strscpyl(filename, sizeof(filename), udev_list_entry_get_name(entry), "/uevent", NULL); fd = open(filename, O_WRONLY); if (fd < 0) { dbg(udev, "error on opening %s: %m\n", filename); @@ -150,7 +149,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) udev_enumerate_add_nomatch_subsystem(udev_enumerate, optarg); break; case 'a': - util_strlcpy(attr, optarg, sizeof(attr)); + util_strscpy(attr, sizeof(attr), optarg); val = strchr(attr, '='); if (val != NULL) { val[0] = 0; @@ -159,7 +158,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) udev_enumerate_add_match_sysattr(udev_enumerate, attr, val); break; case 'A': - util_strlcpy(attr, optarg, sizeof(attr)); + util_strscpy(attr, sizeof(attr), optarg); val = strchr(attr, '='); if (val != NULL) { val[0] = 0; -- cgit v1.2.3-54-g00ecf