mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 02:04:16 +03: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;
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user