diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-07-07 11:07:06 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-07-07 11:16:55 -0400 |
commit | faa1ff8ef8d98fe148ac0efab15fcdf0cabdcaae (patch) | |
tree | 4f0816897494168e1d0bab25367fb5b6782aaaa4 /src/udev/udevadm-info.c | |
parent | 44e6f1bc1a3f11daf569d310de1707f3b423786a (diff) |
Import strxcpyx from upstream
This commit imports strxcpyx from upstream. This is upstream commit
d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d
Note: there were also some very minor code cleanups to
accelerometer.c: line 187
collect.c: lines 35, 140
libudev-device.c: line 780
libudev-hwdb.c: line 300
These are part of upstream commits:
507f22bd0172bff5e5d98145b1419bd472a2c57f
3cf7b686e6b29f78de0af5929602cae4482f6d49
67410e9f73a6cdd8453c78b966451b5151def14a
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udevadm-info.c')
-rw-r--r-- | src/udev/udevadm-info.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 75510c5178..0eaaea19ae 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -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; } @@ -263,7 +263,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; } @@ -387,15 +387,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"); @@ -408,7 +408,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; |