mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
testutils: Fix coverity warning with REGENERATE_OUTPUT
- Don't double check for expectName - actual is always non-NULL by this point, so don't check it either
This commit is contained in:
parent
3445acdbaa
commit
ebfd6f45c3
@ -469,15 +469,14 @@ virtTestDifferenceFullInternal(FILE *stream,
|
|||||||
actualStart = actual;
|
actualStart = actual;
|
||||||
actualEnd = actual + (strlen(actual)-1);
|
actualEnd = actual + (strlen(actual)-1);
|
||||||
|
|
||||||
if (regenerate && (virTestGetRegenerate() > 0) && expectName && actual) {
|
if (expectName && regenerate && (virTestGetRegenerate() > 0)) {
|
||||||
char *regencontent;
|
char *regencontent;
|
||||||
|
|
||||||
/* Try to properly indent qemu argv files */
|
/* Try to properly indent qemu argv files */
|
||||||
if (!(regencontent = virStringReplace(actual, " -", " \\\n-")))
|
if (!(regencontent = virStringReplace(actual, " -", " \\\n-")))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (expectName && actual &&
|
if (virFileWriteStr(expectName, regencontent, 0666) < 0) {
|
||||||
virFileWriteStr(expectName, regencontent, 0666) < 0) {
|
|
||||||
VIR_FREE(regencontent);
|
VIR_FREE(regencontent);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user