diff --git a/src/query/src/queryExecutor.c b/src/query/src/queryExecutor.c index e7b13994245dd43eac01685c5d0d2500bd82b643..9cb2dcd6c69a7f85570808b9dfdce48002ce069d 100644 --- a/src/query/src/queryExecutor.c +++ b/src/query/src/queryExecutor.c @@ -924,7 +924,7 @@ static void blockwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStati STimeWindow win = getActiveTimeWindow(pWindowResInfo, ts, pQuery); if (setWindowOutputBufByKey(pRuntimeEnv, pWindowResInfo, pDataBlockInfo->sid, &win) != TSDB_CODE_SUCCESS) { - return 0; + return; } TSKEY ekey = reviseWindowEkey(pQuery, &win); diff --git a/src/util/inc/tutil.h b/src/util/inc/tutil.h index b7877b4307512ede1b5e2433d4052a28eb008ba4..c4c802a68881107da8a09044ea4eb4aa206c9340 100644 --- a/src/util/inc/tutil.h +++ b/src/util/inc/tutil.h @@ -121,11 +121,7 @@ int64_t strnatoi(char *num, int32_t len); char* strreplace(const char* str, const char* pattern, const char* rep); -#define POW2(x) ((x) * (x)) - -int32_t strdequote(char *src); - -char *paGetToken(char *src, size_t maxLen, char **token, int32_t *tokenLen); +char *paGetToken(char *src, char **token, int32_t *tokenLen); void taosMsleep(int32_t mseconds); @@ -133,8 +129,6 @@ int32_t taosByteArrayToHexStr(char bytes[], int32_t len, char hexstr[]); int32_t taosHexStrToByteArray(char hexstr[], char bytes[]); -int64_t str2int64(char *str); - int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstPath); /** diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index a4c034c48db81b1e49e6b67ab9d7c56f526380c9..8ce4530dbf997b6673d4e8cdd903428ea0a07ddc 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -874,12 +874,13 @@ void tsReadGlobalLogConfig() { olen = vlen = 0; getline(&line, &len, fp); - - paGetToken(line, len, &option, &olen); + line[len - 1] = 0; + + paGetToken(line, &option, &olen); if (olen == 0) continue; option[olen] = 0; - paGetToken(option + olen + 1, len, &value, &vlen); + paGetToken(option + olen + 1, &value, &vlen); if (vlen == 0) continue; value[vlen] = 0; @@ -911,18 +912,19 @@ bool tsReadGlobalConfig() { olen = vlen = 0; getline(&line, &len, fp); - - paGetToken(line, len, &option, &olen); + line[len - 1] = 0; + + paGetToken(line, &option, &olen); if (olen == 0) continue; option[olen] = 0; - paGetToken(option + olen + 1, len, &value, &vlen); + paGetToken(option + olen + 1, &value, &vlen); if (vlen == 0) continue; value[vlen] = 0; // For dataDir, the format is: // dataDir /mnt/disk1 0 - paGetToken(value + vlen + 1, len, &value1, &vlen1); + paGetToken(value + vlen + 1, &value1, &vlen1); tsReadConfigOption(option, value); } @@ -1005,11 +1007,10 @@ int tsCfgDynamicOptions(char *msg) { int olen, vlen, code = 0; int vint = 0; - size_t len = 120; - paGetToken(msg, len, &option, &olen); + paGetToken(msg, &option, &olen); if (olen == 0) return TSDB_CODE_INVALID_MSG_CONTENT; - paGetToken(option + olen + 1, len, &value, &vlen); + paGetToken(option + olen + 1, &value, &vlen); if (vlen == 0) vint = 135; else { diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index ba06d73352c4e372574dc749079cfcf6f9583e07..5f4c90327992ed523ede1491c8a2878ea5a6d9d2 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -164,9 +164,8 @@ char* strtolower(char *dst, const char *src) { return dst; } -char *paGetToken(char *string, size_t maxLen, char **token, int32_t *tokenLen) { +char *paGetToken(char *string, char **token, int32_t *tokenLen) { char quote = 0; - char* start = string; while (*string != 0) { if (*string == ' ' || *string == '\t') { @@ -183,7 +182,7 @@ char *paGetToken(char *string, size_t maxLen, char **token, int32_t *tokenLen) { *token = string; - while (*string != 0 && *string != '\n' && (string - start < maxLen)) { + while (*string != 0) { if (*string == '@' && quote) { //*string = 0; ++string; @@ -337,7 +336,7 @@ int32_t taosByteArrayToHexStr(char bytes[], int32_t len, char hexstr[]) { char hexval[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; for (i = 0; i < len; i++) { - hexstr[i * 2] = hexval[((bytes[i] >> 4) & 0xF)]; + hexstr[i * 2] = hexval[((bytes[i] >> 4u) & 0xF)]; hexstr[(i * 2) + 1] = hexval[(bytes[i]) & 0x0F]; }