Skip to content

src: drop no-op or redundant casts (tidy-up) - #2361

Closed
vszakats wants to merge 6 commits into
libssh2:masterfrom
vszakats:redcast
Closed

vszakats wants to merge 6 commits into
libssh2:masterfrom
vszakats:redcast

Conversation

@vszakats

Copy link
Copy Markdown
Member

No description provided.

@vszakats vszakats changed the title src: drop no-op or redundant casts src: drop no-op or redundant casts (tidy-up) Jul 19, 2026
@vszakats
vszakats requested a review from Copilot July 19, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tidies up the code by removing no-op/redundant pointer casts when initializing struct string_buf instances across several source files, keeping the logic unchanged while simplifying assignments.

Changes:

  • Remove redundant (unsigned char *) casts when assigning already-unsigned char * pointers to string_buf.data/dataptr.
  • Remove redundant casts around SSH2_UNCONST(...) results when assigning into string_buf.data.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/sftp.c Drops redundant casts when initializing string_buf from SFTP input buffers.
src/pem.c Simplifies decoded buffer initialization by removing unnecessary casts.
src/packet.c Removes no-op casts when parsing packet payloads using string_buf.
src/kex.c Removes redundant cast during KEX method parsing buffer setup.
src/hostkey.c Simplifies string_buf initialization from hostkey/signature buffers using SSH2_UNCONST.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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