]> git.ipfire.org Git - thirdparty/libarchive.git/commit
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)
commit7941de217f1595fa4280a5d124e1c2b24d8a1cc3
tree2825664eac25c10b92b5e0d2d359be42d735c210
parent5fe9364e7261b221856eab4bf793911d10aebe1b
Fix syntax error of DONT_FAIL_ON_CRC_ERROR in archive_read_support_fo… (#2066)

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>