Skip to content

Commit 20ce691

Browse files
Merge pull request #257 from kyberias/use-const-strchr
Use const return value with strchr
2 parents c355f30 + 00a0cfb commit 20ce691

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/AsyncWebHeader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const AsyncWebHeader AsyncWebHeader::parse(const char *data) {
1515
if (strchr(data, '\n') || strchr(data, '\r')) {
1616
return AsyncWebHeader(); // Invalid header format
1717
}
18-
char *colon = strchr(data, ':');
18+
const char *colon = strchr(data, ':');
1919
if (!colon) {
2020
return AsyncWebHeader(); // separator not found
2121
}
2222
if (colon == data) {
2323
return AsyncWebHeader(); // Header name cannot be empty
2424
}
25-
char *startOfValue = colon + 1; // Skip the colon
25+
const char *startOfValue = colon + 1; // Skip the colon
2626
// skip one optional whitespace after the colon
2727
if (*startOfValue == ' ') {
2828
startOfValue++;

0 commit comments

Comments
 (0)