优化代码

This commit is contained in:
zhangsheng 2025-05-26 19:26:29 +08:00
parent acfed5f9b3
commit b19f3027fd
2 changed files with 2 additions and 2 deletions

View File

@ -649,7 +649,7 @@ std::string JsonData::JsonCmd_Cgi_60(Param_60 &param){
jsonVal["success"] = true; jsonVal["success"] = true;
jsonVal["message"] = ""; jsonVal["message"] = "";
char file_path[64]={0}; char file_path[64]={0};
char cmd[64]={0}; char cmd[128]={0};
sprintf(cmd, "mv /opt/%s /opt/DataNode/",param.fileName.c_str()); sprintf(cmd, "mv /opt/%s /opt/DataNode/",param.fileName.c_str());
system(cmd); system(cmd);
sprintf(file_path, "/opt/DataNode/%s",param.fileName.c_str()); sprintf(file_path, "/opt/DataNode/%s",param.fileName.c_str());

View File

@ -1036,7 +1036,7 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan
Json::FastWriter WaveValue; Json::FastWriter WaveValue;
std::string WaveData = WaveValue.write(valWaveData); std::string WaveData = WaveValue.write(valWaveData);
char selectCon[128] = {0},whereCon[128] = {0}; char selectCon[128] = {0},whereCon[1024] = {0};
sprintf(selectCon, "channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1", strChannelID.c_str()); sprintf(selectCon, "channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1", strChannelID.c_str());
std::string strTime = sqlite_db_ctrl::instance().GetData("t_data_waveSend", "timeStamp", selectCon); std::string strTime = sqlite_db_ctrl::instance().GetData("t_data_waveSend", "timeStamp", selectCon);
long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str()); long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str());