]> sourceware.org Git - dm.git/commitdiff
fix strncmps
authorAlasdair Kergon <agk@redhat.com>
Wed, 26 Oct 2005 18:33:47 +0000 (18:33 +0000)
committerAlasdair Kergon <agk@redhat.com>
Wed, 26 Oct 2005 18:33:47 +0000 (18:33 +0000)
lib/libdm-deptree.c

index da1eeafa26207fa2f3e49b279bffb2ad0618a429..c2e13010f29bf0e4fe04854928f2cd4a64f70609 100644 (file)
@@ -377,7 +377,10 @@ static int _uuid_prefix_matches(const char *uuid, const char *uuid_prefix, size_
        if (uuid_prefix_len <= 4)
                return 0;
 
-       if (!strcmp(uuid, "LVM-") || strcmp(uuid_prefix, "LVM-"))
+       if (!strncmp(uuid, "LVM-", 4))
+               return 0;
+
+       if (strncmp(uuid_prefix, "LVM-", 4))
                return 0;
 
        if (!strncmp(uuid, uuid_prefix + 4, uuid_prefix_len - 4))
@@ -697,7 +700,7 @@ int dm_deptree_children_use_uuid(struct deptree_node *dnode,
                        return 1;
                }
 
-               if (!strncmp(uuid, uuid_prefix, uuid_prefix_len))
+               if (_uuid_prefix_matches(uuid, uuid_prefix, uuid_prefix_len))
                        return 1;
 
                if (dm_deptree_node_num_children(child, 0))
This page took 0.029792 seconds and 5 git commands to generate.