Search / Sort

This commit is contained in:
2026-08-30 22:24:45 +08:00
parent 3a4717a9d8
commit 0cb98557da
75 changed files with 7570 additions and 7 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ unsigned long c_StringView_ToUL(const c_StringView_t* self, const char** endptr,
// 3. 自动识别进制 (Base == 0) 或校验 16 进制前缀
if (base == 0) {
if (start + 1 < end && *start == '0' && (start[1] == 'x' || start[1] == 'X')) {
if ((c_size_t)(end - start) >= 2 && *start == '0' && (start[1] == 'x' || start[1] == 'X')) {
base = 16;
start += 2;
} else if (start < end && *start == '0') {
@@ -71,7 +71,7 @@ unsigned long c_StringView_ToUL(const c_StringView_t* self, const char** endptr,
}
} else if (base == 16) {
// 如果显式指定了16进制,允许略过 0x/0X 前缀
if (start + 1 < end && *start == '0' && (start[1] == 'x' || start[1] == 'X')) {
if ((c_size_t)(end - start) >= 2 && *start == '0' && (start[1] == 'x' || start[1] == 'X')) {
start += 2;
}
}