From 1a18422fdb224f449149d57d1eaef27173418de2 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Sat, 2 Jul 2022 14:29:56 +0800 Subject: [PATCH 1/2] os: fix sprintf signed char error --- include/os/osString.h | 2 +- source/os/src/osString.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/os/osString.h b/include/os/osString.h index 1b518f9b81..3a4ff18694 100644 --- a/include/os/osString.h +++ b/include/os/osString.h @@ -67,7 +67,7 @@ bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs int32_t tasoUcs4Compare(TdUcs4 *f1_ucs4, TdUcs4 *f2_ucs4, int32_t bytes); TdUcs4* tasoUcs4Copy(TdUcs4 *target_ucs4, TdUcs4 *source_ucs4, int32_t len_ucs4); bool taosValidateEncodec(const char *encodec); -int32_t taosHexEncode(const char *src, char *dst, int32_t len); +int32_t taosHexEncode(const unsigned char *src, char *dst, int32_t len); int32_t taosHexDecode(const char *src, char *dst, int32_t len); int32_t taosWcharWidth(TdWchar wchar); diff --git a/source/os/src/osString.c b/source/os/src/osString.c index e6904f1963..efa65fe191 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -196,7 +196,7 @@ int32_t taosUcs4len(TdUcs4 *ucs4) { } //dst buffer size should be at least 2*len + 1 -int32_t taosHexEncode(const char *src, char *dst, int32_t len) { +int32_t taosHexEncode(const unsigned char *src, char *dst, int32_t len) { if (!dst) { return -1; } From 7a7098315cc5ab0fee9ab0eab0d19c3c34700dbd Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Sat, 2 Jul 2022 14:38:25 +0800 Subject: [PATCH 2/2] os: fix other error --- include/os/osMath.h | 6 ++++++ source/dnode/mnode/impl/src/mndTrans.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/os/osMath.h b/include/os/osMath.h index b0c75f4dd7..74973d9bb2 100644 --- a/include/os/osMath.h +++ b/include/os/osMath.h @@ -20,6 +20,12 @@ extern "C" { #endif +// If the error is in a third-party library, place this header file under the third-party library header file. +// When you want to use this feature, you should find or add the same function in the following sectio +#ifndef ALLOW_FORBID_FUNC +#define qsort QSORT_FUNC_TAOS_FORBID +#endif + #define TPOW2(x) ((x) * (x)) #define TABS(x) ((x) > 0 ? (x) : -(x)) diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 534cba73c7..e1d8969fae 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1025,7 +1025,7 @@ static int32_t mndTransExecNullMsg(SMnode *pMnode, STrans *pTrans, STransAction pTrans->lastAction = pAction->id; pTrans->lastMsgType = pAction->msgType; pTrans->lastEpset = pAction->epSet; - pTrans->lastErrorNo == 0; + pTrans->lastErrorNo = 0; return 0; }