Fix build errors.
This commit is contained in:
parent
430cf9a806
commit
db2a1a84d3
|
@ -426,17 +426,17 @@ static int32_t mndMCfg2DCfg(SMCfgDnodeReq *pMCfgReq, SDCfgDnodeReq *pDCfgReq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t optLen = p - pMCfgReq->config;
|
size_t optLen = p - pMCfgReq->config;
|
||||||
tstrncpy(pDCfgReq->config, pMCfgReq->config, optLen);
|
tstrncpy(pDCfgReq->config, pMCfgReq->config, optLen + 1);
|
||||||
pDCfgReq->config[optLen] = 0;
|
pDCfgReq->config[optLen] = 0;
|
||||||
|
|
||||||
if (' ' == pMCfgReq->config[optLen]) {
|
if (' ' == pMCfgReq->config[optLen]) {
|
||||||
// 'key value'
|
// 'key value'
|
||||||
if (strlen(pMCfgReq->value) != 0) goto _err;
|
if (strlen(pMCfgReq->value) != 0) goto _err;
|
||||||
(void)strcpy(pDCfgReq->value, p + 1);
|
tstrncpy(pDCfgReq->value, p + 1, strlen(p + 1));
|
||||||
} else {
|
} else {
|
||||||
// 'key' 'value'
|
// 'key' 'value'
|
||||||
if (strlen(pMCfgReq->value) == 0) goto _err;
|
if (strlen(pMCfgReq->value) == 0) goto _err;
|
||||||
(void)strcpy(pDCfgReq->value, pMCfgReq->value);
|
tstrncpy(pDCfgReq->value, pMCfgReq->value, strlen(pMCfgReq->value));
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
|
@ -591,11 +591,11 @@ static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pMCfgReq, int32_t optLen, int32
|
||||||
if (' ' == pMCfgReq->config[optLen]) {
|
if (' ' == pMCfgReq->config[optLen]) {
|
||||||
// 'key value'
|
// 'key value'
|
||||||
if (strlen(pMCfgReq->value) != 0) goto _err;
|
if (strlen(pMCfgReq->value) != 0) goto _err;
|
||||||
*pOutValue = taosStr2int32(pMCfgReq->config + optLen + 1);
|
*pOutValue = taosStr2Int32(pMCfgReq->config + optLen + 1, NULL, 10);
|
||||||
} else {
|
} else {
|
||||||
// 'key' 'value'
|
// 'key' 'value'
|
||||||
if (strlen(pMCfgReq->value) == 0) goto _err;
|
if (strlen(pMCfgReq->value) == 0) goto _err;
|
||||||
*pOutValue = taosStr2int32(pMCfgReq->value);
|
*pOutValue = taosStr2Int32(pMCfgReq->value, NULL, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
|
|
Loading…
Reference in New Issue