Skip to content

Conversation

@Keyaku
Copy link
Contributor

@Keyaku Keyaku commented Nov 25, 2025

Changes

  • Used reentrant functions whenever necessary (e.g. strtok() => strtok_r()) to avoid UB in the existence of interruptions.
  • Fixed a few memory leaks.
  • Addressed a few nullable variables being passed to non-null parameters.
  • Dropped some const casts, added other const casts and removed redundant casts.
  • Cleaned up some includes.
  • Other various minor touches.

Why

Better stability, less memory leaks and more maintainable code.

Checkmarks

  • The modified functions have been tested.
  • Used the same indentation as the rest of the project.
  • Updated documentation (changelog).

Changes:
- Added `.clangd` to `.gitignore`.
- Removed last semicolon in some macros.
- Fixed invisibility clangd warning in `root_impl/*.h` by including the header which declares `root_impl_state`.
- Added some system header includes where necessary to appease some compilers & linters.
- Replaced hardcoded `bool` definition with the inclusion of C99's `<stdbool.h>`.
Some changes made possible with SonarLint.

Changes:
- Included some headers  where appropriate, and removed unused ones.
- Removed redundant casts (c:S1905).
- Using pointers-to-const when adequate, for the sake of maintainability (c:S995 and c:S5350).
- Cleaned trailing whitespace.
Changes:
- Replaced `strtok()` with its reentrant alternative `strtok_r()` (c:S1912).
- Fixed a memory leak with `strdup()` in `_apatch_get_package_config()`.
- Addressed nullable values being passed to non-null parameters.
- Dropped `const`-qualifier in `mountinfo` string members, since they are created, modified and used during execution.
- Removed redundant casts.
Changes:
- Moved a variable declaration to its next scope.
- Removed useless boundaries check.
@Keyaku Keyaku requested a review from ThePedroo November 25, 2025 18:55
@Keyaku Keyaku requested a review from ThePedroo November 26, 2025 15:34
Copy link
Member

@ThePedroo ThePedroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ThePedroo ThePedroo merged commit d61e377 into PerformanC:main Nov 28, 2025
1 check passed
@Keyaku Keyaku deleted the zygiskd-cleanup branch November 28, 2025 22:10
@Keyaku Keyaku mentioned this pull request Nov 29, 2025
3 tasks
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.

2 participants