mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Minor code cleanups
This commit is contained in:
parent
f2d63c1633
commit
09d9e5e19b
1 changed files with 8 additions and 13 deletions
|
@ -419,11 +419,10 @@ const char *NET_AdrToString (netadr_t a)
|
|||
{
|
||||
static char s[NET_ADDRSTRMAXLEN];
|
||||
|
||||
if (a.type == NA_LOOPBACK) {
|
||||
if (a.type == NA_LOOPBACK)
|
||||
Com_sprintf (s, sizeof(s), "loopback");
|
||||
} else if (a.type == NA_BOT) {
|
||||
else if (a.type == NA_BOT)
|
||||
Com_sprintf (s, sizeof(s), "bot");
|
||||
}
|
||||
else if (a.type == NA_IP || a.type == NA_IP6)
|
||||
{
|
||||
struct sockaddr_storage sadr;
|
||||
|
@ -440,18 +439,14 @@ const char *NET_AdrToStringwPort (netadr_t a)
|
|||
{
|
||||
static char s[NET_ADDRSTRMAXLEN];
|
||||
|
||||
if (a.type == NA_LOOPBACK) {
|
||||
if (a.type == NA_LOOPBACK)
|
||||
Com_sprintf (s, sizeof(s), "loopback");
|
||||
} else if (a.type == NA_BOT) {
|
||||
else if (a.type == NA_BOT)
|
||||
Com_sprintf (s, sizeof(s), "bot");
|
||||
}
|
||||
else if (a.type == NA_IP || a.type == NA_IP6)
|
||||
{
|
||||
if(a.type == NA_IP)
|
||||
Com_sprintf(s, sizeof(s), "%s:%hu", NET_AdrToString(a), ntohs(a.port));
|
||||
else if(a.type == NA_IP6)
|
||||
Com_sprintf(s, sizeof(s), "[%s]:%hu", NET_AdrToString(a), ntohs(a.port));
|
||||
}
|
||||
else if(a.type == NA_IP)
|
||||
Com_sprintf(s, sizeof(s), "%s:%hu", NET_AdrToString(a), ntohs(a.port));
|
||||
else if(a.type == NA_IP6)
|
||||
Com_sprintf(s, sizeof(s), "[%s]:%hu", NET_AdrToString(a), ntohs(a.port));
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue