Skip to content

Commit d698b5f

Browse files
committed
Make connect cmd defer to the default port
1 parent ed9f3b5 commit d698b5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Client/core/CCommandFuncs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,14 @@ void CCommandFuncs::Connect(const char* szParameters)
267267
strNick = szNick;
268268

269269
// Got all required arguments?
270-
if (!szHost || !szPort || strNick.empty())
270+
if (!szHost || strNick.empty())
271271
{
272-
CCore::GetSingleton().GetConsole()->Print(_("connect: Syntax is 'connect <host> <port> [<nick> <pass>]'"));
272+
CCore::GetSingleton().GetConsole()->Print(_("connect: Syntax is 'connect <host> [<port> <nick> <pass>]'"));
273273
return;
274274
}
275275

276276
// Verify and convert the port number
277-
int iPort = atoi(szPort);
277+
int iPort = szPort ? atoi(szPort) : 22003;
278278
if (iPort <= 0 || iPort > 0xFFFF)
279279
{
280280
CCore::GetSingleton().GetConsole()->Print(_("connect: Bad port number"));

0 commit comments

Comments
 (0)