TunnelDetailFragment: avoid integer overflow
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
2e55e5fd05
commit
b7b5d96b3b
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user