]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/loopdev: comparing an array to null is not useful [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 17 Jul 2014 12:08:18 +0000 (14:08 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 17 Jul 2014 12:08:18 +0000 (14:08 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c

index 2488a6fdb099c3d5d120505c3338f564b252f538..2a2a31782ad8c6985f7dea03c91168488e6bb3a6 100644 (file)
@@ -238,7 +238,7 @@ void loopcxt_enable_debug(struct loopdev_cxt *lc, int enable)
  */
 char *loopcxt_strdup_device(struct loopdev_cxt *lc)
 {
-       if (!lc || !lc->device || !*lc->device)
+       if (!lc || !*lc->device)
                return NULL;
        return strdup(lc->device);
 }
@@ -250,7 +250,7 @@ char *loopcxt_strdup_device(struct loopdev_cxt *lc)
  */
 const char *loopcxt_get_device(struct loopdev_cxt *lc)
 {
-       return lc && lc->device && *lc->device ? lc->device : NULL;
+       return lc && *lc->device ? lc->device : NULL;
 }
 
 /*