diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 17:57:52 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 17:57:52 +0200 |
commit | 065db052211d3bf08d9b0f698a79a8798faf11d2 (patch) | |
tree | 970ac911636e2711c99ab050a7fd341e95ea08a9 /udev/udevadm-trigger.c | |
parent | f58a9099bb2b18f3f683615324a4382b95446305 (diff) |
use more efficient string copying
Diffstat (limited to 'udev/udevadm-trigger.c')
-rw-r--r-- | udev/udevadm-trigger.c | 7 |
1 files changed, 3 insertions, 4 deletions
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; |