solve some issues according to code analysis result
This commit is contained in:
@@ -119,17 +119,13 @@ int main(int argc, const char *argv[])
|
||||
{
|
||||
char *ip = g_ConnectAddress.szServerIP;
|
||||
int &port = g_ConnectAddress.iPort;
|
||||
if (0 == strlen(ip))
|
||||
{
|
||||
strcpy(p+1, "settings.ini");
|
||||
if (_access(path, 0) == -1){
|
||||
ip = argc > 1 ? argv[1] : "127.0.0.1";
|
||||
port = argc > 2 ? atoi(argv[2]) : 19141;
|
||||
}
|
||||
else {
|
||||
GetPrivateProfileStringA("settings", "localIp", "yuanyuanxiang.oicp.net", ip, _MAX_PATH, path);
|
||||
port = GetPrivateProfileIntA("settings", "ghost", 19141, path);
|
||||
}
|
||||
strcpy(p + 1, "settings.ini");
|
||||
if (_access(path, 0) == -1) { // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD>ȴӲ<C8B4><D3B2><EFBFBD><EFBFBD><EFBFBD>ȡֵ<C8A1><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD>g_ConnectAddressȡֵ.
|
||||
ip = argc > 1 ? argv[1] :(strlen(ip)==0 ? "127.0.0.1" : ip);
|
||||
port = argc > 2 ? atoi(argv[2]) : (port==0 ? 6543: port);
|
||||
} else {
|
||||
GetPrivateProfileStringA("settings", "localIp", g_ConnectAddress.szServerIP, ip, _MAX_PATH, path);
|
||||
port = GetPrivateProfileIntA("settings", "ghost", g_ConnectAddress.iPort, path);
|
||||
}
|
||||
printf("[server] %s:%d\n", ip, port);
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user