chiark / gitweb /
use streq instead of strcmp
[elogind.git] / src / udev / udevadm-info.c
index 95f077ca95c3eda76a764114d1d7edf1346efc0d..0f4565eda8abaadb9f49355502106a9ad7cdb4e2 100644 (file)
@@ -45,7 +45,7 @@ static bool skip_attribute(const char *name)
         unsigned int i;
 
         for (i = 0; i < ELEMENTSOF(skip); i++)
-                if (strcmp(name, skip[i]) == 0)
+                if (streq(name, skip[i]))
                         return true;
         return false;
 }
@@ -269,7 +269,7 @@ static struct udev_device *find_device(struct udev *udev, const char *id, const
         char name[UTIL_PATH_SIZE];
 
         if (prefix && !startswith(id, prefix)) {
-                util_strscpyl(name, sizeof(name), prefix, id, NULL);
+                strscpyl(name, sizeof(name), prefix, id, NULL);
                 id = name;
         }
 
@@ -393,15 +393,15 @@ static int uinfo(struct udev *udev, int argc, char *argv[])
                         break;
                 case 'q':
                         action = ACTION_QUERY;
-                        if (strcmp(optarg, "property") == 0 || strcmp(optarg, "env") == 0) {
+                        if (streq(optarg, "property") || streq(optarg, "env")) {
                                 query = QUERY_PROPERTY;
-                        } else if (strcmp(optarg, "name") == 0) {
+                        } else if (streq(optarg, "name")) {
                                 query = QUERY_NAME;
-                        } else if (strcmp(optarg, "symlink") == 0) {
+                        } else if (streq(optarg, "symlink")) {
                                 query = QUERY_SYMLINK;
-                        } else if (strcmp(optarg, "path") == 0) {
+                        } else if (streq(optarg, "path")) {
                                 query = QUERY_PATH;
-                        } else if (strcmp(optarg, "all") == 0) {
+                        } else if (streq(optarg, "all")) {
                                 query = QUERY_ALL;
                         } else {
                                 fprintf(stderr, "unknown query type\n");
@@ -414,7 +414,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[])
                         break;
                 case 'd':
                         action = ACTION_DEVICE_ID_FILE;
-                        util_strscpy(name, sizeof(name), optarg);
+                        strscpy(name, sizeof(name), optarg);
                         break;
                 case 'a':
                         action = ACTION_ATTRIBUTE_WALK;