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.
This commit is contained in:
parent
003f5331fa
commit
03d074a0e8
@ -207,7 +207,8 @@ public class WifiStateChangeService extends Service {
|
|||||||
// the following methods were not added until android-9/Gingerbread
|
// the following methods were not added until android-9/Gingerbread
|
||||||
for (InterfaceAddress address : netIf.getInterfaceAddresses()) {
|
for (InterfaceAddress address : netIf.getInterfaceAddresses()) {
|
||||||
if (inetAddress.equals(address.getAddress()) && !TextUtils.isEmpty(FDroidApp.ipAddressString)) {
|
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();
|
FDroidApp.subnetInfo = (new SubnetUtils(cidr)).getInfo();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user