Skip to content

Fix extra field setter return value - #566

Open
carrerasdarren-cell wants to merge 1 commit into
nih-at:mainfrom
carrerasdarren-cell:fix-extra-field-set-return
Open

Fix extra field setter return value#566
carrerasdarren-cell wants to merge 1 commit into
nih-at:mainfrom
carrerasdarren-cell:fix-extra-field-set-return

Conversation

@carrerasdarren-cell

Copy link
Copy Markdown
Contributor

The extra-field refactor changed zip_file_extra_field_set() from returning 0 directly to returning the boolean result of _zip_extra_fields_set(). This inverted the public API contract: successful calls returned 1 instead of 0, while failures returned 0 instead of -1. In particular, an invalid extra-field index was reported as success.

Map the internal boolean to the documented public return values and add a regression test for the invalid-index path. This behavior is on current main only, so no released version is affected.

Verification:

  • ctest --test-dir build-asan --output-on-failure -j4
  • 191/191 tests passed with AddressSanitizer and UndefinedBehaviorSanitizer enabled.

Assisted-by: OpenAI Codex

Map the internal boolean result to the public API's documented 0/-1 convention and cover the invalid-index error path with a regression test.\n\nAssisted-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant