Skip to content

Conversation

@bagder
Copy link
Member

@bagder bagder commented Jan 1, 2026

Also, skip adding the terminating null that is not used.

Also, skip adding the terminating null that is not used.
@bagder bagder requested a review from Copilot January 1, 2026 17:04
@bagder bagder marked this pull request as ready for review January 1, 2026 17:04
Copy link

Copilot AI left a comment

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 optimizes the inet_ntop6 function by eliminating an unnecessary strlen() call and removing the redundant null terminator that was being added to the temporary buffer. The optimization leverages pointer arithmetic that is already available from the string construction process.

Key changes:

  • Removed the null terminator assignment to the temporary buffer since curlx_strcopy handles null termination
  • Updated overflow check from > to >= to correctly validate buffer space requirements
  • Replaced strlen(tmp) with tp - tmp to use the already-computed string length

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

@bagder bagder closed this in f7d8725 Jan 1, 2026
@bagder bagder deleted the bagder/ntop-copy branch January 1, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant