oops (thanks newkid!)

This commit is contained in:
jrandom
2005-05-01 01:35:23 +00:00
committed by zzz
parent b5ad7642bc
commit ea82f2a8cc
2 changed files with 2 additions and 5 deletions

View File

@@ -557,7 +557,7 @@ public class PeerState {
public static String calculateRemoteHostString(byte ip[], int port) {
StringBuffer buf = new StringBuffer(ip.length * 4 + 5);
for (int i = 0; i < ip.length; i++)
buf.append((int)ip[i]).append('.');
buf.append(ip[i]&0xFF).append('.');
buf.append(port);
return buf.toString();
}

View File

@@ -567,10 +567,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("\">");
byte ip[] = peer.getRemoteIP();
for (int j = 0; j < ip.length; j++) {
if (ip[j] < 0)
buf.append(ip[j] + 255);
else
buf.append(ip[j]);
buf.append(ip[j] & 0xFF);
if (j + 1 < ip.length)
buf.append('.');
}