summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-util.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/libudev/libudev-util.c
parent6ada823a9a0979ea145fd70add1007c21caa45c0 (diff)
udev: use startswith() and streq()
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r--src/libudev/libudev-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index cb17c3f48c..24d402cd2a 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -62,7 +62,7 @@ int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size)
return -1;
link_target[len] = '\0';
- for (back = 0; strncmp(&link_target[back * 3], "../", 3) == 0; back++)
+ for (back = 0; startswith(&link_target[back * 3], "../"); back++)
;
for (i = 0; i <= back; i++) {
base = strrchr(syspath, '/');
@@ -84,11 +84,11 @@ int util_log_priority(const char *priority)
prio = strtol(priority, &endptr, 10);
if (endptr[0] == '\0' || isspace(endptr[0]))
return prio;
- if (strncmp(priority, "err", 3) == 0)
+ if (startswith(priority, "err"))
return LOG_ERR;
- if (strncmp(priority, "info", 4) == 0)
+ if (startswith(priority, "info"))
return LOG_INFO;
- if (strncmp(priority, "debug", 5) == 0)
+ if (startswith(priority, "debug"))
return LOG_DEBUG;
return 0;
}