summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/java
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 12:38:38 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-09 12:38:38 -0600
commitb7b5d96b3bfd966c4154b72fa6ce69d34ec3c64c (patch)
tree59b2fd648e7d9ec61cccf70376f2727a5485d078 /ui/src/main/java
parent2e55e5fd051278a949d698f84580bef12c9324d8 (diff)
TunnelDetailFragment: avoid integer overflow
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java')
-rw-r--r--ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java b/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
index e2adecc3..e6ac7092 100644
--- a/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
+++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
@@ -44,7 +44,7 @@ public class TunnelDetailFragment extends BaseFragment {
return requireContext().getString(R.string.transfer_kibibytes, bytes / 1024.0);
else if (bytes < 1024 * 1024 * 1024)
return requireContext().getString(R.string.transfer_mibibytes, bytes / (1024.0 * 1024.0));
- else if (bytes < 1024 * 1024 * 1024 * 1024)
+ else if (bytes < 1024 * 1024 * 1024 * 1024L)
return requireContext().getString(R.string.transfer_gibibytes, bytes / (1024.0 * 1024.0 * 1024.0));
return requireContext().getString(R.string.transfer_tibibytes, bytes / (1024.0 * 1024.0 * 1024.0) / 1024.0);
}