]> sourceware.org Git - lvm2.git/commitdiff
libdm-config: replace check for 0
authorZdenek Kabelac <zkabelac@redhat.com>
Sun, 7 Mar 2021 20:52:10 +0000 (21:52 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 8 Mar 2021 14:43:27 +0000 (15:43 +0100)
No need to call strlen() when checking for zero length string.

device_mapper/libdm-config.c

index 7ce5620c623ebc1d6c3849fdaaf74990b69ef104..a4c79c20dec2f846abcbd9cf3b75c85ea842ba73 100644 (file)
@@ -599,7 +599,7 @@ static struct dm_config_node *_section(struct parser *p, struct dm_config_node *
                match(TOK_IDENTIFIER);
        }
 
-       if (!strlen(str)) {
+       if (!*str) {
                log_error("Parse error at byte %" PRIptrdiff_t " (line %d): empty section identifier",
                          p->tb - p->fb + 1, p->line);
                return NULL;
This page took 0.03221 seconds and 5 git commands to generate.