build error

This commit is contained in:
xsren 2024-09-26 15:47:05 +08:00
parent 18bc5a048f
commit 6749067c33
2 changed files with 4 additions and 4 deletions

View File

@ -324,7 +324,7 @@ void killAllCheckpointTrans(SMnode *pMnode, SVgroupChangeInfo *pChangeInfo) {
size_t len = 0; size_t len = 0;
void *pKey = taosHashGetKey(pDb, &len); void *pKey = taosHashGetKey(pDb, &len);
stpncpy(p, pKey, 127); tstrncpy(p, pKey, 128);
int32_t code = doKillCheckpointTrans(pMnode, pKey, len); int32_t code = doKillCheckpointTrans(pMnode, pKey, len);
if (code) { if (code) {

View File

@ -87,18 +87,18 @@ char *stpncpy(char *dest, const char *src, int n) {
if (size == n) return dest; if (size == n) return dest;
return memset(dest, '\0', n - size); return memset(dest, '\0', n - size);
} }
#endif #else
char *taosStrndup(const char *s, int size) { char *taosStrndup(const char *s, int size) {
if (s == NULL) { if (s == NULL) {
return NULL; return NULL;
} }
char* p = strndup(s, size); char *p = strndup(s, size);
if (NULL == p) { if (NULL == p) {
terrno = TSDB_CODE_OUT_OF_MEMORY; terrno = TSDB_CODE_OUT_OF_MEMORY;
} }
return p; return p;
} }
#endif
int32_t taosStr2int64(const char *str, int64_t *val) { int32_t taosStr2int64(const char *str, int64_t *val) {
if (str == NULL || val == NULL) { if (str == NULL || val == NULL) {