lib/loopdev: comparing an array to null is not useful [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2014-07-17 14:08:18 +02:00
parent d179d01950
commit cba69bb551

View 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;
}
/*