mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
Merge pull request #3 from Abioy/master
Remove some useless code and check array index before using it
This commit is contained in:
commit
514baf8410
@ -115,7 +115,7 @@ void StatReport::setReportInfo(const StatFPrx& statPrx,
|
||||
_maxReportSize = iMaxReportSize;
|
||||
}
|
||||
vector<string> vtSetInfo = TC_Common::sepstr<string>(strSetDivision,".");
|
||||
if (vtSetInfo.size()!=3 ||(vtSetInfo.size()==3&&(vtSetInfo[0]=="*"||vtSetInfo[1]=="*")))
|
||||
if (vtSetInfo.size()!=3 ||(vtSetInfo[0]=="*"||vtSetInfo[1]=="*"))
|
||||
{
|
||||
_setArea= "";
|
||||
_setID = "";
|
||||
@ -210,7 +210,7 @@ bool StatReport::divison2SetInfo(const string& str, vector<string>& vtSetInfo)
|
||||
{
|
||||
vtSetInfo = TC_Common::sepstr<string>(str,".");
|
||||
|
||||
if (vtSetInfo.size() != 3 ||(vtSetInfo.size()==3&&(vtSetInfo[0]=="*"||vtSetInfo[1]=="*")))
|
||||
if (vtSetInfo.size() != 3 ||(vtSetInfo[0]=="*"||vtSetInfo[1]=="*"))
|
||||
{
|
||||
TLOGERROR(__FUNCTION__ << ":" << __LINE__ << "|bad set name [" << str << endl);
|
||||
return false;
|
||||
|
@ -485,7 +485,7 @@ string Tars2Cpp::generateH(const StructPtr& pPtr, const string& namespaceId) con
|
||||
if (vPtr)
|
||||
{
|
||||
BuiltinPtr bPtr = BuiltinPtr::dynamicCast(vPtr->getTypePtr());
|
||||
if (!bPtr || (bPtr && bPtr->kind() == Builtin::KindString)) //非内建类型或者string 类型不能memset
|
||||
if (!bPtr || bPtr->kind() == Builtin::KindString) //非内建类型或者string 类型不能memset
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ void TC_Cgi::parseNormal(multimap<string, string> &mmpParams, const string& sBuf
|
||||
|
||||
if(iFlag == 0)
|
||||
{
|
||||
while ( (sBuffer[pos] != '=') && (pos < len) )
|
||||
while ( (pos < len) && (sBuffer[pos] != '=') )
|
||||
{
|
||||
sTmp += (sBuffer[pos] == '+') ? ' ' : sBuffer[pos];
|
||||
|
||||
@ -208,7 +208,7 @@ void TC_Cgi::parseNormal(multimap<string, string> &mmpParams, const string& sBuf
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( (sBuffer[pos] != '&') && (pos < len) )
|
||||
while ( (pos < len) && (sBuffer[pos] != '&') )
|
||||
{
|
||||
sTmp += (sBuffer[pos] == '+') ? ' ' : sBuffer[pos];
|
||||
|
||||
|
@ -319,7 +319,6 @@ string TC_ConfigDomain::reverse_parse(const string &s)
|
||||
case '\t':
|
||||
param += "\\t";
|
||||
break;
|
||||
break;
|
||||
case '=':
|
||||
param += "\\=";
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user