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:
parent
d179d01950
commit
cba69bb551
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue