Skip to content

Use const return value with strchr#257

Merged
mathieucarbou merged 1 commit into
ESP32Async:mainfrom
kyberias:use-const-strchr
Aug 4, 2025
Merged

Use const return value with strchr#257
mathieucarbou merged 1 commit into
ESP32Async:mainfrom
kyberias:use-const-strchr

Conversation

@kyberias

@kyberias kyberias commented Aug 4, 2025

Copy link
Copy Markdown

This patch makes the usage of strchr() return value slightly more strict by using const. This doesn't change any functionality but allows the code to be compiled in environments where we are forced to use C++ standard-compliant versions of strchr (that don't return char* when const char* is given).

This change also makes the code a bit safer and correct since the pointers in question are derived from a const char* data-parameter that was never meant for modification any way.

@mathieucarbou mathieucarbou merged commit 20ce691 into ESP32Async:main Aug 4, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants