cancel rm tail space

This commit is contained in:
Bob Liu 2023-12-07 14:00:50 +08:00
parent 07af4e9a08
commit 4737b00879
1 changed files with 1 additions and 14 deletions

View File

@ -109,10 +109,7 @@ int32_t toDoubleEx(const char *z, int32_t n, uint32_t type, double* value) {
if (errno == ERANGE || errno == EINVAL) {
return TSDB_CODE_FAILED;
}
// rm tail space
while (n > 1 && z[n-1] == ' ') {
n--;
}
if (endPtr - z != n) {
return TSDB_CODE_FAILED;
}
@ -151,11 +148,6 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) {
return TSDB_CODE_SUCCESS;
}
// rm tail space
while (n > 1 && z[n-1] == ' ') {
n--;
}
// 1. try to parse as integer
*value = taosStr2Int64(z, &endPtr, 10);
if (endPtr - z == n) {
@ -258,11 +250,6 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) {
return TSDB_CODE_SUCCESS;
}
// rm tail space
while (n > 1 && z[n-1] == ' ') {
n--;
}
// 1. parse as integer
*value = taosStr2UInt64(p, &endPtr, 10);
if (*p == '-' && *value) {