aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2005-06-26 09:17:33 +0000
committerHolger Zickner <[email protected]>2005-06-26 09:17:33 +0000
commit5c5548cd1021990914588de0a996a418d2a7d6d2 (patch)
tree11a24123611193c999fcb8b70bc0078bcd9ea2c5
parent8c8458ab72d5ada28cdd3c2e6b1295f056978c63 (diff)
parseInt/Long may throw an exception
-rw-r--r--src/jake2/client/CL_input.java6
-rw-r--r--src/jake2/sys/NET.java15
2 files changed, 14 insertions, 7 deletions
diff --git a/src/jake2/client/CL_input.java b/src/jake2/client/CL_input.java
index 3e5e4de..b4fadfa 100644
--- a/src/jake2/client/CL_input.java
+++ b/src/jake2/client/CL_input.java
@@ -2,7 +2,7 @@
* java
* Copyright (C) 2004
*
- * $Id: CL_input.java,v 1.6 2005-06-07 12:57:21 hzi Exp $
+ * $Id: CL_input.java,v 1.7 2005-06-26 09:17:33 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -141,7 +141,7 @@ public class CL_input {
static void KeyUp(kbutton_t b) {
int k;
String c;
- long uptime;
+ int uptime;
c = Cmd.Argv(1);
if (c.length() > 0)
@@ -168,7 +168,7 @@ public class CL_input {
// save timestamp
c = Cmd.Argv(2);
- uptime = Long.parseLong(c);
+ uptime = Lib.atoi(c);
if (uptime != 0)
b.msec += uptime - b.downtime;
else
diff --git a/src/jake2/sys/NET.java b/src/jake2/sys/NET.java
index 249f739..702447d 100644
--- a/src/jake2/sys/NET.java
+++ b/src/jake2/sys/NET.java
@@ -1,7 +1,7 @@
/*
* NET.java Copyright (C) 2003
*
- * $Id: NET.java,v 1.7 2005-02-20 18:33:16 cawe Exp $
+ * $Id: NET.java,v 1.8 2005-06-26 09:17:33 hzi Exp $
*/
/*
* Copyright (C) 1997-2001 Id Software, Inc.
@@ -27,10 +27,17 @@ package jake2.sys;
import jake2.Defines;
import jake2.Globals;
import jake2.game.cvar_t;
-import jake2.qcommon.*;
+import jake2.qcommon.Com;
+import jake2.qcommon.Cvar;
+import jake2.qcommon.netadr_t;
+import jake2.qcommon.sizebuf_t;
+import jake2.util.Lib;
import java.io.IOException;
-import java.net.*;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
@@ -140,7 +147,7 @@ public final class NET {
a.ip = ia.getAddress();
a.type = Defines.NA_IP;
if (address.length == 2)
- a.port = Integer.parseInt(address[1]);
+ a.port = Lib.atoi(address[1]);
return true;
} catch (Exception e) {
Com.Println(e.getMessage());