]> sourceware.org Git - lvm2.git/commitdiff
Reuse result of previous strchr
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:08:15 +0000 (12:08 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:08:15 +0000 (12:08 +0000)
Reported by clang as: Argument with 'nonnull' attribute passed null

Reuse the result of the last strchr() call - make sure, 'st' point is not
null for the next strchr() call.

tools/toollib.c

index 02c496248f4fba4e87312a2c3345f832679ff552..5adc160c05cc0c286f7c36492c56b71d5959ee9d 100644 (file)
@@ -869,7 +869,7 @@ const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
                        while (*st == '/')
                                st++;
 
-               if (!strchr(vg_name, '/') || strchr(st, '/')) {
+               if (!st || strchr(st, '/')) {
                        log_error("\"%s\": Invalid path for Logical Volume",
                                  lv_name);
                        return 0;
This page took 0.035948 seconds and 5 git commands to generate.