summaryrefslogtreecommitdiff
path: root/src/udev-event.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2012-01-23 05:21:13 +0100
committerKay Sievers <kay.sievers@vrfy.org>2012-01-23 05:21:13 +0100
commita7ef118174332ae98cb80763b0dfb97823e6a395 (patch)
tree592cbefbf1a9ac2fa4af9150d9d74714f77b97bc /src/udev-event.c
parent0ecfcbd4f758f9ff10926156eb8c7a7542650627 (diff)
move variable inside condition
Diffstat (limited to 'src/udev-event.c')
-rw-r--r--src/udev-event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev-event.c b/src/udev-event.c
index 227c186236..0b6db30eda 100644
--- a/src/udev-event.c
+++ b/src/udev-event.c
@@ -347,12 +347,12 @@ subst:
l = util_strpcpy(&s, l, udev_device_get_devnode(dev));
break;
case SUBST_NAME: {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
-
if (event->name != NULL) {
l = util_strpcpy(&s, l, event->name);
dbg(event->udev, "substitute custom name '%s'\n", event->name);
} else {
+ size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
+
l = util_strpcpy(&s, l, &udev_device_get_devnode(dev)[devlen]);
dbg(event->udev, "substitute name'%s'\n", &udev_device_get_devnode(dev)[devlen]);
}