I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 8d2a5160 authored by zzz's avatar zzz
Browse files

* GeoIP: Fix minor bugs (thanks Arsene)

parent dc0cc49d
No related branches found
No related tags found
No related merge requests found
...@@ -212,10 +212,10 @@ public class GeoIP { ...@@ -212,10 +212,10 @@ public class GeoIP {
String[] s = buf.toString().split(","); String[] s = buf.toString().split(",");
long ip1 = Long.parseLong(s[0]); long ip1 = Long.parseLong(s[0]);
long ip2 = Long.parseLong(s[1]); long ip2 = Long.parseLong(s[1]);
while (search[idx].longValue() < ip1 && idx < search.length) { while (idx < search.length && search[idx].longValue() < ip1) {
idx++; idx++;
} }
while (search[idx].longValue() >= ip1 && search[idx].longValue() <= ip2 && idx < search.length) { while (idx < search.length && search[idx].longValue() >= ip1 && search[idx].longValue() <= ip2) {
rv[idx++] = s[2].toLowerCase(); rv[idx++] = s[2].toLowerCase();
} }
} catch (IndexOutOfBoundsException ioobe) { } catch (IndexOutOfBoundsException ioobe) {
......
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