From 03d074a0e8bb666c5c6ed2328d047059af060982 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 11 Sep 2015 11:38:58 +0200 Subject: [PATCH] always use Locale.ENGLISH for formatting Strings for the machine For Strings that are meant to be displayed to humans, using the default Locale makes sense. But this String is meant to be parsed by code, so it should force the Locale to make sure the digits are always rendered in the same format. --- F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java b/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java index 860371ec8..5befdbaf2 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java +++ b/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java @@ -207,7 +207,8 @@ public class WifiStateChangeService extends Service { // the following methods were not added until android-9/Gingerbread for (InterfaceAddress address : netIf.getInterfaceAddresses()) { if (inetAddress.equals(address.getAddress()) && !TextUtils.isEmpty(FDroidApp.ipAddressString)) { - String cidr = String.format("%s/%d", FDroidApp.ipAddressString, address.getNetworkPrefixLength()); + String cidr = String.format(Locale.ENGLISH, "%s/%d", + FDroidApp.ipAddressString, address.getNetworkPrefixLength()); FDroidApp.subnetInfo = (new SubnetUtils(cidr)).getInfo(); break; }