summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-info.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-16 20:27:44 +0200
committerKay Sievers <kay@vrfy.org>2012-04-16 20:54:17 +0200
commit33502ffe2eb7b56cdd018a4fb6830d7828519fad (patch)
tree02180c0a82618b09f7346edaa7b28dd93eb81c9f /src/udev/udevadm-info.c
parent6ada823a9a0979ea145fd70add1007c21caa45c0 (diff)
udev: use startswith() and streq()
Diffstat (limited to 'src/udev/udevadm-info.c')
-rw-r--r--src/udev/udevadm-info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index 3b14139459..229c0a2849 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -325,7 +325,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[])
goto exit;
}
/* add /dev if not given */
- if (strncmp(optarg, "/dev", strlen("/dev")) != 0)
+ if (!startswith(optarg, "/dev"))
util_strscpyl(name, sizeof(name), "/dev/", optarg, NULL);
else
util_strscpy(name, sizeof(name), optarg);
@@ -361,7 +361,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[])
goto exit;
}
/* add sys dir if needed */
- if (strncmp(optarg, "/sys", strlen("/sys")) != 0)
+ if (!startswith(optarg, "/sys"))
util_strscpyl(path, sizeof(path), "/sys", optarg, NULL);
else
util_strscpy(path, sizeof(path), optarg);