[TD_543] fix coverity scan, cid:267764

This commit is contained in:
Shengliang Guan 2020-06-08 09:22:50 +00:00
parent ac26d4ab4d
commit d27dcd5e35
1 changed files with 3 additions and 3 deletions

View File

@ -117,8 +117,8 @@ typedef struct {
} SDbInfo; } SDbInfo;
typedef struct { typedef struct {
char name[TSDB_TABLE_NAME_LEN + 1]; char name[TSDB_TABLE_NAME_LEN];
char metric[TSDB_TABLE_NAME_LEN + 1]; char metric[TSDB_TABLE_NAME_LEN];
} STableRecord; } STableRecord;
typedef struct { typedef struct {
@ -871,7 +871,7 @@ int32_t taosDumpMetric(char *metric, SDumpArguments *arguments, FILE *fp) {
int fd = -1; int fd = -1;
STableRecord tableRecord; STableRecord tableRecord;
strcpy(tableRecord.metric, metric); tstrncpy(tableRecord.metric, metric, TSDB_TABLE_NAME_LEN);
sprintf(command, "select tbname from %s", metric); sprintf(command, "select tbname from %s", metric);
result = taos_query(taos, command); result = taos_query(taos, command);