]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: comparing an array to null is not useful [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 13:50:22 +0000 (14:50 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 13:50:22 +0000 (14:50 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index 3a904f2f88af7fb347a015589a51157d032bf9aa..5ff8802d1e36b8e2e831f33cc5950a5c36590d3a 100644 (file)
@@ -452,7 +452,7 @@ static void log_btmp(struct login_context *cxt)
 
        if (cxt->hostname) {
                xstrncpy(ut.ut_host, cxt->hostname, sizeof(ut.ut_host));
-               if (cxt->hostaddress && *cxt->hostaddress)
+               if (*cxt->hostaddress)
                        memcpy(&ut.ut_addr_v6, cxt->hostaddress,
                               sizeof(ut.ut_addr_v6));
        }
@@ -604,7 +604,7 @@ static void log_utmp(struct login_context *cxt)
        ut.ut_pid = cxt->pid;
        if (cxt->hostname) {
                xstrncpy(ut.ut_host, cxt->hostname, sizeof(ut.ut_host));
-               if (cxt->hostaddress && *cxt->hostaddress)
+               if (*cxt->hostaddress)
                        memcpy(&ut.ut_addr_v6, cxt->hostaddress,
                               sizeof(ut.ut_addr_v6));
        }