restrict server name/city to max allowed length if given as a command line argument, see #91
This commit is contained in:
parent
bb8fc63c5d
commit
8e86908d92
1 changed files with 4 additions and 4 deletions
|
@ -80,10 +80,10 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
||||||
if ( iServInfoNumSplitItems >= 3 )
|
if ( iServInfoNumSplitItems >= 3 )
|
||||||
{
|
{
|
||||||
// [this server name]
|
// [this server name]
|
||||||
ThisServerListEntry.strName = slServInfoSeparateParams[0];
|
ThisServerListEntry.strName = slServInfoSeparateParams[0].left ( MAX_LEN_SERVER_NAME );
|
||||||
|
|
||||||
// [this server city]
|
// [this server city]
|
||||||
ThisServerListEntry.strCity = slServInfoSeparateParams[1];
|
ThisServerListEntry.strCity = slServInfoSeparateParams[1].left ( MAX_LEN_SERVER_CITY );
|
||||||
|
|
||||||
// [this server country as QLocale ID]
|
// [this server country as QLocale ID]
|
||||||
const int iCountry = slServInfoSeparateParams[2].toInt();
|
const int iCountry = slServInfoSeparateParams[2].toInt();
|
||||||
|
@ -132,11 +132,11 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
|
||||||
|
|
||||||
// [server n name]
|
// [server n name]
|
||||||
NewServerListEntry.strName =
|
NewServerListEntry.strName =
|
||||||
slServInfoSeparateParams[iCurUsedServInfoSplitItems + 1];
|
slServInfoSeparateParams[iCurUsedServInfoSplitItems + 1].left ( MAX_LEN_SERVER_NAME );
|
||||||
|
|
||||||
// [server n city]
|
// [server n city]
|
||||||
NewServerListEntry.strCity =
|
NewServerListEntry.strCity =
|
||||||
slServInfoSeparateParams[iCurUsedServInfoSplitItems + 2];
|
slServInfoSeparateParams[iCurUsedServInfoSplitItems + 2].left ( MAX_LEN_SERVER_CITY );
|
||||||
|
|
||||||
// [server n country as QLocale ID]
|
// [server n country as QLocale ID]
|
||||||
const int iCountry =
|
const int iCountry =
|
||||||
|
|
Loading…
Reference in a new issue