From patchwork Tue Jan 12 16:04:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 59632 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2826537lbb; Tue, 12 Jan 2016 08:07:29 -0800 (PST) X-Received: by 10.31.52.73 with SMTP id b70mr73858129vka.16.1452614849886; Tue, 12 Jan 2016 08:07:29 -0800 (PST) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id c137si30081849vkf.95.2016.01.12.08.07.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Jan 2016 08:07:29 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0CG4qFf024873; Tue, 12 Jan 2016 11:04:52 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0CG4oJM031147 for ; Tue, 12 Jan 2016 11:04:50 -0500 Received: from colepc.redhat.com (ovpn-113-33.phx2.redhat.com [10.3.113.33]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0CG4nOa018089; Tue, 12 Jan 2016 11:04:49 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 12 Jan 2016 11:04:45 -0500 Message-Id: <44366fb1b8ffc50d0fd8149a5b7fd6c6612e696d.1452614685.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] testutils: Fix coverity warning with REGENERATE_OUTPUT X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com - Don't double check for expectName - actual is always non-NULL by this point, so don't check it either --- tests/testutils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/testutils.c b/tests/testutils.c index 4ffea0c..b587f83 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -469,15 +469,14 @@ virtTestDifferenceFullInternal(FILE *stream, actualStart = actual; actualEnd = actual + (strlen(actual)-1); - if (regenerate && (virTestGetRegenerate() > 0) && expectName && actual) { + if (expectName && regenerate && (virTestGetRegenerate() > 0)) { char *regencontent; /* Try to properly indent qemu argv files */ if (!(regencontent = virStringReplace(actual, " -", " \\\n-"))) return -1; - if (expectName && actual && - virFileWriteStr(expectName, regencontent, 0666) < 0) { + if (virFileWriteStr(expectName, regencontent, 0666) < 0) { VIR_FREE(regencontent); return -1; }