shithub: choc

Download patch

ref: 4488827a394a8abb086abc068a01865865ffcb13
parent: 0074d76e44a91f7beabc7463dd652d15caa88dbc
author: Turo Lamminen <[email protected]>
date: Tue Dec 11 14:35:12 EST 2018

net: Hoist now-identical code out of both branches of if

--- a/src/net_sdl.c
+++ b/src/net_sdl.c
@@ -335,15 +335,14 @@
 
     colon = strchr(address, ':');
 
+    addr_hostname = M_StringDuplicate(address);
     if (colon != NULL)
     {
-	addr_hostname = M_StringDuplicate(address);
 	addr_hostname[colon - address] = '\0';
 	addr_port = atoi(colon + 1);
     }
     else
     {
-	addr_hostname = M_StringDuplicate(address);
 	addr_port = port;
     }