Skip to content

fix(IPAddress): remove redundant condition in fromString6 - #282

Open
pruthvi828 wants to merge 1 commit into
arduino:masterfrom
pruthvi828:fix/ipaddress-fromstring6-tautological-check
Open

pruthvi828 wants to merge 1 commit into
arduino:masterfrom
pruthvi828:fix/ipaddress-fromstring6-tautological-check

Conversation

@pruthvi828

@pruthvi828 pruthvi828 commented Sep 22, 2026 •

Copy link
Copy Markdown

Summary

Fixes #249

In IPAddress::fromString6, after verifying c == ':', the code checks if (*address == ':'). Inside this conditional branch, *address is guaranteed to be ':', making the condition *address != '\0' in if (*address != '\0' && *(address + 1) == ':') always true (tautological).

Changes

  • Cleaned up if (*(address + 1) == ':') in �pi/IPAddress.cpp.
  • Added corresponding unit test coverage in est/src/IPAddress/test_fromString6.cpp.

Verification

  • Tested with Catch2 test suite across valid and invalid IPv6 test fixtures.

@CLAassistant

CLAassistant commented Sep 22, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Always true condition in IPAddress string-to-ipv6 conversion

2 participants