From: Karel Zak Date: Thu, 17 Jul 2014 12:08:18 +0000 (+0200) Subject: lib/loopdev: comparing an array to null is not useful [coverity scan] X-Git-Tag: v2.25~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba69bb55115470bb37d5d859a7ecdcadfd67aa8;p=thirdparty%2Futil-linux.git lib/loopdev: comparing an array to null is not useful [coverity scan] Signed-off-by: Karel Zak --- diff --git a/lib/loopdev.c b/lib/loopdev.c index 2488a6fdb0..2a2a31782a 100644 --- a/lib/loopdev.c +++ b/lib/loopdev.c @@ -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; } /*