Describe the bug
file: butil/endpoint.cpp
function: int str2endpoint(const char* str, EndPoint* point) {
line: 291 for (++end; isspace(*end); ++end);
first "++end" is bug? should be for (; isspace(*end); ++end);
第一个"++end"是bug吧?应该是 for ( ; isspace(end); ++end);
char end = NULL;
point->port = strtol(str + i, &end, 10);
if (end == str + i) {
return -1;
} else if (*end) {
for (++end; isspace(*end); ++end); // <-- BUG: increments end before checking
if (*end) {
return -1;
}
}
example: "0.0.0.0:8000a" is ok
例如"0.0.0.0:8000a" 中的a就被跳过了。
To Reproduce
Expected behavior
Versions 1.14.1
OS:
Compiler:
brpc:
protobuf:
Additional context/screenshots