Fix small error

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-10-01 17:54:47 +02:00
parent d0b64f4bd5
commit 91647978e6
2 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ android {
applicationId 'com.wireguard.android' applicationId 'com.wireguard.android'
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 440 versionCode 441
versionName '0.0.20181001' versionName '0.0.20181001'
buildConfigField 'int', 'MIN_SDK_VERSION', "$minSdkVersion.apiLevel" buildConfigField 'int', 'MIN_SDK_VERSION', "$minSdkVersion.apiLevel"
} }

View File

@ -11,6 +11,7 @@ import com.wireguard.android.Application;
import com.wireguard.android.R; import com.wireguard.android.R;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@ -59,7 +60,7 @@ public class InetEndpoint {
if (resolvedHost == null) if (resolvedHost == null)
resolvedHost = candidates[0]; resolvedHost = candidates[0];
} }
return String.format(resolvedHost instanceof Inet4Address ? return String.format(resolvedHost instanceof Inet6Address ?
"[%s]:%d" : "%s:%d", resolvedHost.getHostAddress(), port); "[%s]:%d" : "%s:%d", resolvedHost.getHostAddress(), port);
} }