]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix syntax error of DONT_FAIL_ON_CRC_ERROR in archive_read_support_fo… (#2066)
authorterrynini <terrynini38514@gmail.com>
Sun, 24 Mar 2024 00:04:11 +0000 (08:04 +0800)
committerGitHub <noreply@github.com>
Sun, 24 Mar 2024 00:04:11 +0000 (17:04 -0700)
Following code snippet in
`libarchive/archive_read_support_format_7zip.c` causing a build fail
while enable the `DONT_FAIL_ON_CRC_ERROR`

```
/* Check the EncodedHeader CRC.*/
if (r == 0 && zip->header_crc32 != next_header_crc) {
archive_set_error(&a->archive, -1,
#ifndef DONT_FAIL_ON_CRC_ERROR
    "Damaged 7-Zip archive");
r = -1;
#endif
```

I fix it like this:

```
/* Check the EncodedHeader CRC.*/
if (r == 0 && zip->header_crc32 != next_header_crc) {
#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, -1,
    "Damaged 7-Zip archive");
r = -1;
#endif
```

Co-authored-by: Huka <huka@DEVCORE.local>

No differences found