diff options
author | darkvater <darkvater@openttd.org> | 2004-09-12 23:35:01 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-09-12 23:35:01 +0000 |
commit | 01dd0219d312060d64d714c566a5307f6b187057 (patch) | |
tree | 1cb3f0310e6977a2f58d828b00a1a70c173bce95 /network_gui.c | |
parent | ec21a64c03c01dcf9fa842721766562262a49d66 (diff) | |
download | openttd-01dd0219d312060d64d714c566a5307f6b187057.tar.xz |
(svn r229) -Fix: Some more const stuff fixed .(Tron)
-Fix: ParseConnectionString() function to parse network connection string: <IP>[:<PORT>][#<PLAY_AS] .
Diffstat (limited to 'network_gui.c')
-rw-r--r-- | network_gui.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/network_gui.c b/network_gui.c index cfacbe262..216be02c8 100644 --- a/network_gui.c +++ b/network_gui.c @@ -170,27 +170,13 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) case WE_ON_EDIT_TEXT: { byte *b = e->edittext.str; if (*b != 0) { - byte * ip = NULL; - byte * port = NULL; - byte * player = NULL; - byte c; + const byte *port = NULL; + const byte *player = NULL; uint16 rport; rport = _network_server_port; - c = 0; - ip = b; - - while (b[c] != 0) { - if (((char)b[c]) == '#') { - player = &b[c+1]; - b[c] = 0; - } - if (((char)b[c]) == ':') { - port = &b[c+1]; - b[c] = 0; - } - c++; - } + + ParseConnectionString(&player, &port, b); if (player!=NULL) _network_playas = atoi(player); if (port!=NULL) rport = atoi(port); |