From 6749067c33456d4386a49f14985a9f465ce81ae3 Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 26 Sep 2024 15:47:05 +0800 Subject: [PATCH] build error --- source/dnode/mnode/impl/src/mndStreamTrans.c | 2 +- source/os/src/osString.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndStreamTrans.c b/source/dnode/mnode/impl/src/mndStreamTrans.c index c16016cf13..7171d44da4 100644 --- a/source/dnode/mnode/impl/src/mndStreamTrans.c +++ b/source/dnode/mnode/impl/src/mndStreamTrans.c @@ -324,7 +324,7 @@ void killAllCheckpointTrans(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo) { size_t len = 0; void *pKey = taosHashGetKey(pDb, &len); - stpncpy(p, pKey, 127); + tstrncpy(p, pKey, 128); int32_t code = doKillCheckpointTrans(pMnode, pKey, len); if (code) { diff --git a/source/os/src/osString.c b/source/os/src/osString.c index 28ea46ba1a..d265ed510a 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -87,18 +87,18 @@ char *stpncpy(char *dest, const char *src, int n) { if (size == n) return dest; return memset(dest, '\0', n - size); } -#endif - +#else char *taosStrndup(const char *s, int size) { if (s == NULL) { return NULL; } - char* p = strndup(s, size); + char *p = strndup(s, size); if (NULL == p) { terrno = TSDB_CODE_OUT_OF_MEMORY; } return p; } +#endif int32_t taosStr2int64(const char *str, int64_t *val) { if (str == NULL || val == NULL) {