summaryrefslogtreecommitdiff
path: root/core/network.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-20 23:32:29 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-20 23:32:29 -0400
commite494785abdc468c412f15fd6dca5eabd17413cc2 (patch)
treea719333c0451df32cfb3c5e4dd6e3db2353dea62 /core/network.c
parentc12853275c03ca6153c9424f29220bc5b8903875 (diff)
Fixed bug.
Diffstat (limited to 'core/network.c')
-rw-r--r--core/network.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/network.c b/core/network.c
index 849c7e2a..7880eae6 100644
--- a/core/network.c
+++ b/core/network.c
@@ -108,10 +108,10 @@ void networking_poll(Networking_Core *net)
108} 108}
109 109
110uint8_t at_startup_ran; 110uint8_t at_startup_ran;
111static void at_startup(void) 111static int at_startup(void)
112{ 112{
113 if (at_startup_ran != 0) 113 if (at_startup_ran != 0)
114 return; 114 return 0;
115 115
116#ifdef WIN32 116#ifdef WIN32
117 WSADATA wsaData; 117 WSADATA wsaData;
@@ -124,6 +124,7 @@ static void at_startup(void)
124#endif 124#endif
125 srand((uint32_t)current_time()); 125 srand((uint32_t)current_time());
126 at_startup_ran = 1; 126 at_startup_ran = 1;
127 return 0;
127} 128}
128 129
129/* TODO: put this somewhere 130/* TODO: put this somewhere
@@ -143,7 +144,8 @@ static void at_shutdown(void)
143 returns NULL if there are problems */ 144 returns NULL if there are problems */
144Networking_Core *new_networking(IP ip, uint16_t port) 145Networking_Core *new_networking(IP ip, uint16_t port)
145{ 146{
146 at_startup(); 147 if(at_startup() != 0)
148 return NULL;
147 /* initialize our socket */ 149 /* initialize our socket */
148 Networking_Core *temp = calloc(1, sizeof(Networking_Core)); 150 Networking_Core *temp = calloc(1, sizeof(Networking_Core));
149 151