summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-12 21:47:36 +0100
committerLennart Poettering <lennart@poettering.net>2013-02-13 00:56:13 +0100
commit641906e9366891e0ad3e6e38b7396a427678c4cf (patch)
tree47f90e01b79c50ab0839f0a0a10a8fae81dd9a25 /src/udev
parent8d6167101696a28b7ac61b48fd2c1920564c4e90 (diff)
use strneq instead of strncmp
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/scsi_id/scsi_id.c8
-rw-r--r--src/udev/scsi_id/scsi_serial.c2
-rw-r--r--src/udev/udev-builtin-net_id.c2
-rw-r--r--src/udev/udev-rules.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
index fa0413c462..d664787fd9 100644
--- a/src/udev/scsi_id/scsi_id.c
+++ b/src/udev/scsi_id/scsi_id.c
@@ -267,10 +267,10 @@ static int get_file_options(struct udev *udev,
if (vendor == NULL) {
if (vendor_in == NULL)
break;
- } else if ((vendor_in && strncmp(vendor, vendor_in,
- strlen(vendor_in)) == 0) &&
- (!model_in || (strncmp(model, model_in,
- strlen(model_in)) == 0))) {
+ } else if ((vendor_in && strneq(vendor, vendor_in,
+ strlen(vendor_in))) &&
+ (!model_in || (strneq(model, model_in,
+ strlen(model_in))))) {
/*
* Matched vendor and optionally model.
*
diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c
index 950b8adc0a..d522a23a08 100644
--- a/src/udev/scsi_id/scsi_serial.c
+++ b/src/udev/scsi_id/scsi_serial.c
@@ -436,7 +436,7 @@ static int do_scsi_page0_inquiry(struct udev *udev,
* If the vendor id appears in the page assume the page is
* invalid.
*/
- if (!strncmp((char *)&buffer[VENDOR_LENGTH], dev_scsi->vendor, VENDOR_LENGTH)) {
+ if (strneq((char *)&buffer[VENDOR_LENGTH], dev_scsi->vendor, VENDOR_LENGTH)) {
log_debug("%s: invalid page0 data\n", dev_scsi->kernel);
return 1;
}
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 7ffdaad73f..c55c34d614 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -223,7 +223,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
snprintf(str, sizeof(str), "%s/%s/address", slots, dent->d_name);
if (read_one_line_file(str, &address) >= 0) {
/* match slot address with device by stripping the function */
- if (strncmp(address, udev_device_get_sysname(names->pcidev), strlen(address)) == 0)
+ if (strneq(address, udev_device_get_sysname(names->pcidev), strlen(address)))
hotplug_slot = i;
free(address);
}
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index a86f8c365a..d2810a01d8 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1737,7 +1737,7 @@ static int match_key(struct udev_rules *rules, struct token *token, const char *
if (next != NULL) {
size_t matchlen = (size_t)(next - s);
- match = (matchlen == len && strncmp(s, val, matchlen) == 0);
+ match = (matchlen == len && strneq(s, val, matchlen));
if (match)
break;
} else {