diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-07-24 13:39:50 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-24 17:57:56 +0200 |
commit | 7689905c78e9312dc43b9927d523bbe14e707698 (patch) | |
tree | 924048a71fff914642b3f2c57cfe535668816abf /app/src/main/java/com/wireguard/config/Peer.java | |
parent | 284e42647c375894fa0baf17080680a8545be7a6 (diff) |
config: Remove Locale based string format
The configurations are supposed to be in a very specific
format which is not user-facing and hence doesn't have to
be adjusted for locale avoiding both the redundancy as well
as potential breakages in the configuration file format from
different locales.
Fixes: 71c67aa24ae2 ("config: Minor cleanup")
Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/wireguard/config/Peer.java')
-rw-r--r-- | app/src/main/java/com/wireguard/config/Peer.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/src/main/java/com/wireguard/config/Peer.java b/app/src/main/java/com/wireguard/config/Peer.java index b3532eeb..2a4f4465 100644 --- a/app/src/main/java/com/wireguard/config/Peer.java +++ b/app/src/main/java/com/wireguard/config/Peer.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; -import java.util.Locale; import java9.lang.Iterables; @@ -72,7 +71,7 @@ public class Peer { private String getEndpointString() { if (endpoint == null) return null; - return String.format(Locale.getDefault(), "%s:%d", endpoint.getHostString(), endpoint.getPort()); + return String.format("%s:%d", endpoint.getHostString(), endpoint.getPort()); } public int getPersistentKeepalive() { @@ -104,12 +103,10 @@ public class Peer { if (endpoint.isUnresolved()) throw new UnknownHostException(endpoint.getHostString()); if (endpoint.getAddress() instanceof Inet6Address) - return String.format(Locale.getDefault(), - "[%s]:%d", + return String.format("[%s]:%d", endpoint.getAddress().getHostAddress(), endpoint.getPort()); - return String.format(Locale.getDefault(), - "%s:%d", + return String.format("%s:%d", endpoint.getAddress().getHostAddress(), endpoint.getPort()); } |