summaryrefslogtreecommitdiffstats
path: root/daemon/devsparts.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-09 14:26:21 +0100
committerJim Meyering <meyering@redhat.com>2009-11-09 22:34:16 +0100
commit3e70b34eed5a48640e20fbf6dcba774aaace1f3c (patch)
tree5bb681d85d8ff394f562b095e70c36d4ac5f7b5d /daemon/devsparts.c
parent627f89351d06e43564b47ea42cabaa522284c2a1 (diff)
downloadlibguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.tar.gz
libguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.tar.xz
libguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.zip
change strncmp() == 0 to STREQLEN()
git grep -l 'strncmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
Diffstat (limited to 'daemon/devsparts.c')
-rw-r--r--daemon/devsparts.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/daemon/devsparts.c b/daemon/devsparts.c
index 76852cca..60e7aa8c 100644
--- a/daemon/devsparts.c
+++ b/daemon/devsparts.c
@@ -53,10 +53,10 @@ foreach_block_device (block_dev_func_t func)
struct dirent *d = readdir(dir);
if(NULL == d) break;
- if (strncmp (d->d_name, "sd", 2) == 0 ||
- strncmp (d->d_name, "hd", 2) == 0 ||
- strncmp (d->d_name, "vd", 2) == 0 ||
- strncmp (d->d_name, "sr", 2) == 0) {
+ if (STREQLEN (d->d_name, "sd", 2) ||
+ STREQLEN (d->d_name, "hd", 2) ||
+ STREQLEN (d->d_name, "vd", 2) ||
+ STREQLEN (d->d_name, "sr", 2)) {
char dev_path[256];
snprintf (dev_path, sizeof dev_path, "/dev/%s", d->d_name);
@@ -153,7 +153,7 @@ add_partitions(const char *device,
errno = 0;
struct dirent *d;
while ((d = readdir (dir)) != NULL) {
- if (strncmp (d->d_name, device, strlen (device)) == 0) {
+ if (STREQLEN (d->d_name, device, strlen (device))) {
char part[256];
snprintf (part, sizeof part, "/dev/%s", d->d_name);