Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions IPExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static string[] Find(string ip)
var start = index[ip_prefix_value];
var max_comp_len = offset - 262144 - 4;
long index_offset = -1;
var index_length = -1;
long index_length = -1;
byte b = 0;
for (start = start * 9 + 262144; start < max_comp_len; start += 9)
{
Expand All @@ -58,7 +58,7 @@ public static string[] Find(string ip)
{
index_offset = BytesToLong(b, indexBuffer[start + 6], indexBuffer[start + 5],
indexBuffer[start + 4]);
index_length = (0xFF & indexBuffer[start + 7] << 8) + indexBuffer[start + 8];
index_length = BytesToLong(b, b, indexBuffer[start + 7], indexBuffer[start + 8]);
break;
}
}
Expand Down Expand Up @@ -100,7 +100,7 @@ private static void Load()

var indexLength = BytesToLong(dataBuffer[0], dataBuffer[1], dataBuffer[2], dataBuffer[3]);
indexBuffer = new byte[indexLength];
Array.Copy(dataBuffer, 4, indexBuffer, 0, indexLength);
Array.Copy(dataBuffer, 4, indexBuffer, 0, dataBuffer.Length - 4);
offset = (int)indexLength;

for (var i = 0; i < 256; i++)
Expand Down