Skip to content
Snippets Groups Projects
Commit b77541b5 authored by James R.'s avatar James R.
Browse files

Use a pointer for port_name

Using strcpy is stupid because we don't know how long the argument would be.
There's no need for a buffer anyway.

(cherry picked from commit 4e321012894b2aa87e312597f19be26b30545a8b)
parent b1f5e66a
No related branches found
No related tags found
No related merge requests found
...@@ -246,7 +246,7 @@ static size_t numbans = 0; ...@@ -246,7 +246,7 @@ static size_t numbans = 0;
static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
static boolean init_tcp_driver = false; static boolean init_tcp_driver = false;
static char port_name[8] = DEFAULTPORT; static const char *port_name = DEFAULTPORT;
#ifndef NONET #ifndef NONET
...@@ -1485,10 +1485,11 @@ boolean I_InitTcpNetwork(void) ...@@ -1485,10 +1485,11 @@ boolean I_InitTcpNetwork(void)
// Combined -udpport and -clientport into -port // Combined -udpport and -clientport into -port
// As it was really redundant having two seperate parms that does the same thing // As it was really redundant having two seperate parms that does the same thing
{ {
if (M_IsNextParm()) /*
strcpy(port_name, M_GetNextParm()); If it's NULL, that's okay! Because then
else we'll get a random port from getaddrinfo.
strcpy(port_name, "0"); */
port_name = M_GetNextParm();
} }
// parse network game options, // parse network game options,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment