Skip to content

Commit 3cd42df

Browse files
committed
Make addAddress locale safe
Using regular string concatenation to avoid unexpected results in some locales. Change-Id: I47dd5e174c4a2e88dc18e014002820cdbf63fcad
1 parent ad955fe commit 3cd42df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/net/VpnService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public Builder addAddress(InetAddress address, int prefixLength) {
329329
throw new IllegalArgumentException("Bad address");
330330
}
331331

332-
mAddresses.append(String.format(" %s/%d", address.getHostAddress(), prefixLength));
332+
mAddresses.append(' ' + address.getHostAddress() + '/' + prefixLength);
333333
return this;
334334
}
335335

0 commit comments

Comments
 (0)