]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/strutils: keep static analyzer happy [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 15 May 2019 14:09:16 +0000 (16:09 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 15 May 2019 14:09:16 +0000 (16:09 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/strutils.c

index 8076574c5d83f4f19c3d3294d93ce48611fcb9cd..e170f560fce325bbc4cc270978ada4a7e49057a0 100644 (file)
@@ -869,8 +869,10 @@ int streq_paths(const char *a, const char *b)
                    ((a_seg && *a_seg == '/') || (b_seg && *b_seg == '/')))
                        return 1;
 
+               if (!a_seg || !b_seg)
+                       break;
                if (a_sz != b_sz || strncmp(a_seg, b_seg, a_sz) != 0)
-                       return 0;
+                       break;
 
                a = a_seg + a_sz;
                b = b_seg + b_sz;